react-pubg
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published



🐔
react-pubg




React hooks for pubg.ts

Package Version Package Monthly Downloads Docs

🚀 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>;
}

/react-pubg/

    Package Sidebar

    Install

    npm i react-pubg

    Weekly Downloads

    2

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    709 kB

    Total Files

    12

    Last publish

    Collaborators

    • nurodev