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

# TypeScript client

> Use the generated REST client and handle typed responses

Aura maintains a generated TypeScript REST client in the repository at
`packages/aura-sdk-typescript`. It is generated from the canonical OpenAPI
artifact and provides typed paths, parameters and response shapes.

The generated package is named `@aura-app/sdk`. Public npm installation is not
currently verified. Obtain the package artifact from your Aura integration
contact before adding it to an external project. Generating this client does
not publish a package or make a release available to consumers.

## Read leads

Once the package artifact is installed or linked in your project:

```typescript theme={null}
import { createClient } from "@aura-app/sdk";

const apiKey = process.env.AURA_API_KEY;
if (!apiKey) throw new Error("Set AURA_API_KEY before running this example");
const aura = createClient({ apiKey });
const { data, error, response } = await aura.GET("/v1/leads", {
  params: { query: { limit: 50 } },
});
if (error) {
  throw new Error(`${response.status}: ${error.code} (${error.requestId})`);
}
console.log(data);
```

The client defaults to the production API. To test against staging, pass
`baseUrl: "https://staging-api.aura-app.ai"` to `createClient`. Keep your key on
the server. The same scopes, test-key restrictions and rate limits described
in [Making requests](https://docs.api.aura-app.ai/requests.md) apply to client calls.

## Responses and pagination

Methods return `{ data, error, response }`. Check `error` before consuming
`data`, and use `response` for status and headers. For list requests, send the
returned `pagination.next_cursor` as the next request's `cursor`, keeping your
filters unchanged. See [List leads](https://docs.api.aura-app.ai/openapi/v1/leads/get.md) for the full response.

## Choosing an interface

Use the client for typed REST requests. Use the [GraphQL endpoint](https://docs.api.aura-app.ai/graphql.md)
when you need a GraphQL operation. The TypeScript client does not generate
GraphQL query types. Both interfaces document the same underlying resources;
their field names and transport envelopes differ.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.