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

drip-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drip-api

Node client for Drip Api https://www.drip.co/

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Drip Node client library (unofficial)

A Node toolkit for the Drip API. Based on the official Ruby client library:

Installation

Requirements:

  • npm v1.4.0 or newer
  • node v0.10 or newer

yarn

yarn add drip-api

npm

npm i drip-api --save

Authentication

For private integrations, you may use your personal API key (found here) via the apiKey option:

client = require('drip-api')({
  apiKey: "YOUR_API_KEY",
  accountId: "YOUR_ACCOUNT_ID"
})

For public integrations, pass in the user's OAuth token via the accessToken option:

client = require('drip-api')({
  accessToken: "YOUR_ACCESS_TOKEN", // obtained from oauth
  accountId: "YOUR_ACCOUNT_ID"      // obtained from oauth
})

Your account ID can be found here. Most API actions require an account ID, with the exception of methods like the "list accounts" endpoint.

Usage

Since the Drip client is a flat API client, most API actions are available as methods on the client object. The following methods are currently available:

ActionMethod
List accountsclient.accounts(callback)
Track an eventclient.trackEvent(email, action, properties, options, callback)
Track a batch of eventsclient.trackEvents([<events array>])
  • All methods return promises and also support an asynchronous callback. For example:
// promises
client.accounts().then(function (response) {
  // response
}).catch(function (error) {
  // error
})

// callbacks
client.accounts(function (error, response) {
  // if (error) // handle error
  // response
})

Note: We do not have complete API coverage yet. If we are missing an API method that you need to use in your application, please file an issue and/or open a pull request. See the official REST API docs for a complete API reference.

Debugging

This library follows the debug logger standard for optional logger output. To see logger output from this library set DEBUG env variable to 'drip'. For example to see log output in tests:

DEBUG=drip npm test

Contributing

  1. Fork it ( https://github.com/crowdcst/drip/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Notes about contributing

  • Be sure to include jasmine specs for new functionality
  • Follow the StandardJS formatting guidelines. Our test command enforces these guidelines and builds will fail if your code is not compliant.
  • Use yarn (yarn add) for adding new packages so that yarn.lock gets updated

Keywords

FAQs

Package last updated on 08 Feb 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