You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@apolitical/apis-client

Package Overview
Dependencies
Maintainers
0
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apolitical/apis-client

Node.js module to interact with Apolitical's APIs

4.1.2
latest
npmnpm
Version published
Weekly downloads
6
-53.85%
Maintainers
0
Weekly downloads
 
Created
Source

Apolitical APIs Client

Node.js module to interact with Apolitical's APIs

How do I get set up?

Requirements

Requires the following to run:

  • node.js 16.13.0+
  • yarn

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

Keywords

HTTP

FAQs

Package last updated on 12 Dec 2024

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