Node.js module to interact with Apolitical's APIs

Usage no npm install needed!

<script type="module">
  import apoliticalApisClient from 'https://cdn.skypack.dev/@apolitical/apis-client';


Apolitical APIs Client

Node.js module to interact with Apolitical's APIs

How do I get set up?


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


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

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

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.


  • Add Apolitical Logger to replace console