@apolitical/apis-client

4.1.0-rc.0 • Public • Published

Apolitical APIs Client

Node.js module to interact with Apolitical's APIs

How do I get set up?

Requirements

Requires the following to run:

Initial setup

Clone repository:

git clone git@gitlab.com:apolitical/node-modules/apis-client.git

Install dependencies:

yarn install

Run tests:

yarn test

Usage

Here is a short example on how to use this module.

const fs = require('fs');
const apoliticalAPIsClient = require('@apolitical/apis-client');
require('dotenv').config();

const config = {
  url: `https://beta.apolitical.co/api/people-api`,
  sessionSecret: Buffer.from('base64encodedSessionSecret', 'base64').toString('ascii'),
  pfx: fs.readFileSync('/Users/username/someFolder/certFilename.p12'),
  passphrase: Buffer.from('base64encodedCertPassword', 'base64').toString('ascii'),
}

const { user } = apoliticalAPIsClient.people(config);

let usersBatch = await user.list({ offset: 0, count: 100 });

You can get the session secret from the platform-secrets repo. The PFX file is the one you use on your machine to access beta/rc.

TODOs

  • Add Apolitical Logger to replace console

Readme

Keywords

Package Sidebar

Install

npm i @apolitical/apis-client

Weekly Downloads

97

Version

4.1.0-rc.0

License

MIT

Unpacked Size

36.5 kB

Total Files

42

Last publish

Collaborators

  • npm-apolitical-styleguide