Git Product home page Git Product logo

blizzard-api's Introduction

@blizzard-api/*

The @blizzard-api collection aims to help you connect to the Blizzard Battle.net API as easily and painlessly as possible. The packages are split up by game, and will contain all the endpoints, parameters, and responses you need to get started.

Installation

If you already have a way of authenticating your application with battle.net, you only need to install @blizzard-api/core and the relevant game package you want, e.g.:

npm i @blizzard-api/core @blizzard-api/wow

Currently available packages are:

  • @blizzard-api/d3
  • @blizzard-api/wow
  • @blizzard-api/classic-wow

Planned packages are:

  • @blizzard-api/hs
  • @blizzard-api/sc2

The core package gives you access to helper functions such as getBlizzardApi which will quickly get you the hostname and locales for a specific region.

The game package will let you access paths, namespaces, parameters and more for each endpoint. This can imported like so:

import { achievement, wow } from "@blizzard-api/wow"

const achievement = wow.achievement(123);
        ^ { path: string, namespace: string }
//OR LIKE SO
const achievement = achievement(123);
        ^ { path: string, namespace: string }

If you additionally want to have a axios client with built in helpers, you can install @blizzard-api/client which will let you easily connect to the API and begin consuming it.

npm i @blizzard-api/client
import { createBlizzardApiClient } from '@blizzard-api/client';
import { wow } from '@blizzard-api/wow';

const client = await createBlizzardApiClient({
  key: 'environment.blizzardClientId',
  secret: 'environment.blizzardClientSecret',
  origin: 'eu',
});

//Response will automatically be typed with the appropriate values
const response = await client.sendRequest(wow.commodities());

console.log(response.data);
                      ^ typeof AuctionHouseCommoditiesResponse

Authentication

Please refer to the battle.net documentation for guides on how to obtain Blizzard API credentials.

TODO

This list is generally prioritized but no promises that things will be addressed in this order.

  • Add a package for the following games/flavours
    • Diablo III
    • Hearthstone
    • StarCraft II

blizzard-api's People

Contributors

pewtro avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.