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

battlefield-companion

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

battlefield-companion

Connect to battlefield companion api

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Battlefield Companion

This is a node-js super simple wrapper for the battlefield companion API. Designed to make it easy to obtain stats from battlefield companion.

Installation

This module requires node-js and python to be installed inorder to work properly. I tried very hard to use node only for getting the authentication tokens, but it appears pythons Sessions.request library is just easier to use. Since node-js requires python anyway, I don't really see this as an issue.

npm install battlefield-companion

Usage

const BFC = require('battlefield-companion');
const email = YOUR_EA_EMAIL_ADDRESS;
const password = YOUR_EA_PASSWORD;

BFC(email, password, (err, bfApi) => {
  // Now you are logged in, so you can use the bfApi object to perform requests
  const personaId = YOUR_PERSONA_ID;

  bfApi.getCareerForOwnedGamesByPersonaId(personaId, (error, result) => {
    if (!error) {
      // your battlefield stats will be in JSON format here.
      console.log(result);
    }
  });
});

Advanced Usage

Since EA has not released all of the methods via public, I cant share what they are! However, you have all of them at your disposal (should you know any)

BFC(email, password, (err, bfApi) => {
  bfApi.get({
    method: 'Stats.getCareerForOwnedGamesByPersonaId',
    params: {
      personaId: YOUR_PERSONA_ID
    }
  }, (err, result) => {
    if (err) {
      throw new Error(err);
    }
    console.log(result);
  })
});

Keywords

FAQs

Package last updated on 11 Jan 2017

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