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

# Overview

> When to use the TypeScript SDK vs raw HTTP for the Soundlink Public API.

The Public API is **HTTP-first** — every endpoint works with `curl`, Python, or your own client. The official TypeScript SDK wraps the same routes with types, auth, pagination helpers, and JSONL streaming for Node.js and Edge runtimes.

New here? Start with [Quickstart](/docs/quickstart) (REST) or jump to [Access the API with TypeScript](/docs/typescript-sdk).

## REST API vs SDK

|                   | **REST API**                                  | **TypeScript SDK**                       |
| ----------------- | --------------------------------------------- | ---------------------------------------- |
| **Best for**      | Any language, data pipelines, one-off scripts | Node.js, TypeScript, Edge runtimes       |
| **Auth**          | Set `Authorization: Bearer` on every request  | Set once on the client constructor       |
| **Types**         | [API Reference](/docs/api-reference) schemas       | Built-in TypeScript types                |
| **Errors**        | Parse the JSON envelope yourself              | `{ data, error, meta? }` on every method |
| **Pagination**    | Follow `pagination` cursors manually          | `listAll()` async iterators              |
| **JSONL exports** | Stream `application/x-ndjson` yourself        | `for await` + `.collect()`               |
| **Retries**       | Implement backoff on `429` / `5xx`            | Built-in (configurable)                  |

Both hit the same base URL and return the same JSON envelope. The SDK does not add capabilities beyond what the API exposes — including create, budget, stop, and tiers for wallet campaigns (`generation: 3`).

## TypeScript SDK

Install from npm: [`soundlink`](https://www.npmjs.com/package/soundlink) · Source: [github.com/Fan-ID/lib](https://github.com/Fan-ID/lib)

Requires **Node.js 18+** (native `fetch`). See the [TypeScript guide](/docs/typescript-sdk) for install, write examples (`Idempotency-Key`), metrics, and configuration.

<Warning>
  Server-side only. Never expose your `sk_*` API key in a browser or mobile app — call Soundlink from your backend and keep the key in environment variables.
</Warning>
