🚀 Install
Install it locally in your project
npm i --save react-pubg
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",
});
if (loading) return <>Loading...</>;
if (error) return <>Error fetching player data</>;
return <pre>{JSON.stringify(player, null, 4)}</pre>;
}