> ## Documentation Index
> Fetch the complete documentation index at: https://leadping.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK

> Install the Leadping TypeScript SDK from npm, configure Kiota authentication, create a request adapter, and call Leadping API endpoints.

* Package: [@leadping/sdk on npm](https://www.npmjs.com/package/@leadping/sdk)
* Repository: [leadpingai/leadping-typescript](https://github.com/leadpingai/leadping-typescript)

## Install

```bash theme={null}
npm install @leadping/sdk
```

Install a Kiota HTTP adapter in the application that will call Leadping:

```bash theme={null}
npm install @microsoft/kiota-http-fetchlibrary
```

## Create a client

The SDK exports `createLeadpingOpenApiClient`. For most SDK integrations, pass it a Kiota request adapter that attaches `Authorization: Bearer lp_...`. Use `Authorization: Bearer <leadping_user_access_token>` only when acting as a signed-in user, and use `Authorization: Bearer lp_src_...` only when intentionally calling lead ingestion endpoints.

```ts theme={null}
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

```ts theme={null}
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.
