Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pubg.ts

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubg.ts

A lightweight PUBG TypeScript API Wrapper

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source



🐔
pubg.ts




A lightweight PUBG TypeScript API Wrapper

Package Version Package Monthly Downloads Docs API Example




🚀 Install

Install it locally in your project

npm i --save pubg.ts

# Or with Yarn

yarn add pubg.ts

🦄 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!

Here's a few small examples of what you can do with this library

import { Shard, usePlayer, useMatch, useSeason } from "pubg.ts";

// Get a single or multiple player(s) using their name or ID
const player = await usePlayer({
  apiKey: "your_key_goes_here",
  value: "single_name_or_id_or_array_of_such",

  // Optional for all hooks (Default: Steam)
  shard: Shard.STEAM,
});

// Fetch a data from a single match
const match = await useMatch({
  apiKey: "your_key_goes_here",
  id: "a036c694-be29-4dea-833d-b6ff84323de7",
});

// Get the current active season
const activeSeason = await useSeason({
  apiKey: "your_key_goes_here",
});

Or you can use the Client class API instead

import { Client, Shard } from "pubg.ts";

const client = new Client({
  apiKey: "your_key_goes_here",

  // Optional (Default: Steam)
  shard: Shard.STEAM,
});

// Get a single or multiple player(s) using their name or ID
const player = await api.getPlayer({
  value: "single_name_or_id_or_array_of_such",
});

// Fetch a data from a single match
const match = await client.getMatch({
  id: "a036c694-be29-4dea-833d-b6ff84323de7",
});

// Get the current active season
const activeSeason = await client.getCurrentSeason();

❤️ Credits

  • ickerio: This project was heavily inspired by pubg.js

Keywords

FAQs

Package last updated on 10 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc