New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

autopilot-sdk

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autopilot-sdk

Node SDK for Autopilot

  • 0.0.6
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-88%
Maintainers
1
Weekly downloads
 
Created
Source

Intro

This is an un-official Node SDK for interfacing the Autopilot API. You can view the REST api documentation here Some cool features include:

  • Pass a normal JSON object and it would figure out which ones are custom fields and which ones are not
  • Automatically reformat keys to contain Autopilot data types along with all neccessary hyphens. E.g.{'Foo Bar': true} will re-format to {'boolean--Foo--Bar': true}
  • Add/Update/Delete Contact
  • Unsubscribe Contact from a list
  • Create lists
  • Add Contacts to lists
  • Get all Segments
  • Register/Unregister hooks etc...

Installation

> npm i -S autopilot-sdk

Usage

import Autopilot from 'autopilot-sdk';

const autopilot = new Autopilot('<API_KEY>');
//=> autopilot instance

API

The Autopilot instance has instance members that access the scopes of the API. Namely: contacts, lists, journeys, segments, etc... Below is the list of the methods for all the scopes.

All calls on the contact/contacts scope must have a contact_id or email member parameter. Find more in the Autopilot documentation.

contacts#save()

Parameters:

  • data - An Object containing new/existing user details

Return Value: Returns a promise that resolves to:

//=> { contact_id: '<id>' }
Example
import Autopilot from 'autopilot-sdk';

const autopilot = new Autopilot(<EXAMPLE_API_KEY>);
const contactData = {
  'email': 'johndoe@example.com',
  'Full Name': 'John Doe',
  'Gender': 'male',
  'age': 35,
};

await autopilot.contacts.save(contactData);
//=> { contact_id: 'person_32941749279223008202071' }

Keywords

FAQs

Package last updated on 01 Sep 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