Skip to main content

Install

npm install @leadping/sdk
Install a Kiota HTTP adapter in the application that will call Leadping:
npm install @microsoft/kiota-http-fetchlibrary

Create a client

The SDK exports createLeadpingOpenApiClient. Pass it a Kiota request adapter that attaches either Authorization: Bearer <token> or X-Leadping-Api-Key: <key>.
import { createLeadpingOpenApiClient } from "@leadping/sdk";

const requestAdapter = createLeadpingRequestAdapter();
const client = createLeadpingOpenApiClient(requestAdapter);

const me = await client.users.me.get();
createLeadpingRequestAdapter is your application code. The generated SDK does not own token storage or API key handling.

Common calls

const source = await client.sources.byId("source-id").get();
const lead = await client.leads.byId("lead-id").get();
const currentUser = await client.users.me.get();
Use generated request body types from @leadping/sdk when creating or updating records.