0.1.2 • Published 2 years ago

react-pubg v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

🚀 Install

Install it locally in your project

npm i --save react-pubg

# Or with Yarn

yarn add react-pubg

🦄 Usage

Sign for a developer account

You'll first need to sign up on the PUBG developer API site. Using this account you can create a API token

Register an app

With an account created, you can create a new developer application that will provide you with your API key.

Make something!

import { usePlayer } from "react-pubg";

function App() {
  const {
    data: player,
    loading,
    error,
  } = usePlayer({
    apiKey: "...",
    value: "WackyJacky101", // Or an array of player names
  });

  if (loading) return <>Loading...</>;

  if (error) return <>Error fetching player data</>;

  return <pre>{JSON.stringify(player, null, 4)}</pre>;
}