SDK Hub

SDKs for developers.

Integrate Leadpush using the languages you love. Manage contacts, events, suppressions and API workflows directly in your app.

Quick start

import { Leadpush } from '@leadpush/sdk-node'

const client = new Leadpush(process.env.LEADPUSH_API_KEY!)

const contacts = await client.contacts().list({
  page: 1,
  per_page: 10,
})

console.log(contacts.data)

SDK Directory

Choose your language.

Browse official SDKs for connecting backend applications to Leadpush, with more language options added as they become available.

Node.js Install

Installation & Setup

Get from install to your first Leadpush API call in just a few minutes.

1

Install the package

Add the Node.js SDK to the backend project that will call the Leadpush API.

# npm
npm install @leadpush/sdk-node

# pnpm
pnpm add @leadpush/sdk-node

# yarn
yarn add @leadpush/sdk-node
2

Set your API key

Store the key in your environment or secret manager so it never ships to browser code.

LEADPUSH_API_KEY=leadpush_api_key
3

Create the client

Create a shared Leadpush client from your server-side application code.

import { Leadpush } from '@leadpush/sdk-node'

export const leadpush = new Leadpush(process.env.LEADPUSH_API_KEY!)
4

Make the first request

List the first page of contacts from your workspace.

const contacts = await leadpush.contacts().list({
  page: 1,
  per_page: 10,
})

console.log(contacts.data)

SDK Coverage

SDK helpers for common workflows.

SDKs make common Leadpush API workflows easier to call from application code, pairing language-specific helpers with low-level requests.

Fully Typed

Build against fully typed APIs with predictable request parameters, response models, and editor support.

Events

Capture and inspect customer activity with structured APIs that keep event data consistent across your app.

Fields

Work with workspace data definitions through clear SDK helpers for custom properties and metadata.

Suppressions

Keep opt-out and delivery exclusion logic close to your application with dedicated suppression helpers.

Pagination helpers

Move through large result sets with pagination utilities that fit naturally into backend workflows.

Low-level requests

Reach newer or specialized API endpoints while keeping authentication and error handling inside the SDK.

Pagination

Handle large result sets with less boilerplate.

Use SDK pagination helpers to read one response at a time or stream records through backend jobs, sync tasks, and reporting workflows.

// Stream individual records across every page.
for await (const contact of client.contacts().listAll({ per_page: 100 })) {
  console.log(contact.uuid)
}

// Iterate one paginated response at a time.
for await (const page of client.contacts().cursor({ per_page: 100 })) {
  console.log(page.meta.current_page, page.data.length)
}

Errors

Respond to API issues with predictable handling.

Use consistent SDK error handling to route authentication, validation, timeout, missing resource, and unsupported endpoint states through your application logic.

ApiErrorUnauthorizedErrorForbiddenErrorNotFoundErrorValidationErrorTimeoutErrorUnsupportedEndpointError
import { UnauthorizedError, ValidationError } from '@leadpush/sdk-node'

try {
  await client.contacts().list()
} catch (error) {
  if (error instanceof UnauthorizedError) {
    console.error('Invalid API key')
  }

  if (error instanceof ValidationError) {
    console.error(error.response)
  }
}

Start Building

Add Leadpush to your application.

Choose an SDK, create an API key, and connect Leadpush resources to your backend services.