pipedrive-client

Typescript or Javascript client for the Pipedrive API.

Usage no npm install needed!

<script type="module">
  import pipedriveClient from 'https://cdn.skypack.dev/pipedrive-client';
</script>

README

pipedrive-client

Typescript or Javascript client for the Pipedrive API.

Compatibility

This library is written using Promises, and meant to work with async/await in Typescript.

It will also work just fine in Javascript, but most of the examples are written for Typescript.

Background

This library was originally written as a strongly typed, Promise-friendly alternative to the pipedrive/client-nodejs library available from Pipedrive. Where possible, the object structures and available functions in this library mimic those in pipedrive/client-nodejs, with signatures changed to use Promises instead of callback functions.

From that repo:

Pipedrive is a sales pipeline software that gets you organized. It's a powerful sales CRM with effortless sales pipeline management. See www.pipedrive.com for details.

Install

npm install pipedrive-client

Usage

With a pre-set API token, in JavaScript:

var Pipedrive = require('pipedrive-client');
var pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE', { strictMode: true });

(The { strictMode: true } is here for backward compatibility, ignored, and can be omitted.)

In Typescript:

import {Pipedrive} from 'pipedrive-client';
const pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE');

A simple "Hello world" that lists some deals

Here's a quick example that will list some deals from your Pipedrive account:

import {Pipedrive} from 'pipedrive-client';
const pipedrive = new Pipedrive.Client('YOUR_API_TOKEN_HERE');

const deals = pipedrive.Deals.getAll({limit: 5}).deals;
for (let i = 0; i < deals.length; i++) {
    console.log(deals[i].title + ' (worth ' + deals[i].value + ' ' + deals[i].currency + ')');
}

Supported Objects

  • Deals
  • Persons

To-be-supported Objects

These are not yet supported, but support could easily be added by willing contributors following the patterns already established:

  • Activities
  • ActivityTypes
  • Authorizations
  • Currencies
  • CompanyFeatures
  • CompanySettings
  • DealFields
  • Files
  • Filters
  • Goals
  • Notes
  • Organizations
  • OrganizationFields
  • PermissionSets
  • PersonFields
  • Pipelines
  • Products
  • ProductFields
  • Roles
  • SearchResults
  • Stages
  • Users
  • Webhooks

Supported operations for object collections

TODO: Document this (See Collection).

Supported operations for each object

TODO: Document this (See PipedriveObject).

Operations with nested objects

TODO: Document this

Examples

Get 15 first deals using the first deals filter

API Documentation

The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1.

Testing

To run unit tests, execute npm test.

Licence

TBD. We built this at Casetext for ourselves, but we're willing to share with others. If you're interested in using this library, email stokes@casetext.com to discuss.

Contribution

TBD