# TypeScript SDK

> The server-side @adeli/sdk SDK preview, its response model, and release availability.

Canonical: <https://www.tryadeli.com/docs/sdk>

`@adeli/sdk` is Adeli's server-side TypeScript SDK. It is designed for Node.js 22+ services: keep your API key in server configuration and never expose it in a browser bundle.

> **Warning: Pre-release availability**
>
> The SDK is in coordinated pre-release work and is **not published to npm yet**. Do not add it to a production dependency list or rely on an unreleased version. This page describes the intended public interface; installation instructions and a minimum version will be added after an authorized release.

The client uses `https://app.tryadeli.com` as its origin by default. Resource calls take explicit `{ path, query, body }` input and return `{ data, status, headers }`; Adeli does not rewrite provider-specific fields or hide `202`/`207` outcomes.

## Planned server-side quickstart

Once a released version is listed here, install that exact version in a Node.js 22+ service and provide its key at runtime. This read-only example is tagged for SDK package validation; it does not make a network request while documentation is checked.

```ts sdk
import { Adeli } from "@adeli/sdk";

const adeli = new Adeli({ apiKey: "rk_live_replace_on_server" });

export async function listProfiles() {
  const response = await adeli.profiles.listProfiles();
  return response.data;
}
```

The same client exposes operation-oriented resources such as `profiles`, `accounts`, `posts`, `comments`, `messages`, `analytics`, `ads`, and `usage`. A base URL is an origin, not an `/api/v1` path:

```ts sdk
import { Adeli } from "@adeli/sdk";

const adeli = new Adeli({
  apiKey: "rk_live_replace_on_server",
  baseURL: "http://localhost:3000",
});

export async function getProfile(profileId: string) {
  return adeli.profiles.getProfile({ path: { profileId } });
}
```

## Connection and publishing results

Starting a connection returns an authorization URL. Send that URL to the customer's browser; the API key remains on your server. A publishing request can return accepted or partial results, so inspect the returned status and data rather than automatically retrying a write.

```ts sdk
import { Adeli } from "@adeli/sdk";

const adeli = new Adeli({ apiKey: "rk_live_replace_on_server" });

export async function startInstagramConnection(profileId: string) {
  const { data } = await adeli.profiles.startConnection({
    path: { profileId },
    body: {
      platform: "instagram",
      redirectUrl: "https://client.example/adeli/callback",
    },
  });

  return data.authUrl;
}
```

Use the [API reference](https://www.tryadeli.com/docs/api) for the wire contract until the released SDK reference is available. Existing curl, JavaScript, and Python samples in the [quickstart](https://www.tryadeli.com/docs/quickstart) remain the supported integration path during this pre-release period. See [SDK migration notes](https://www.tryadeli.com/docs/sdk-migrations) for compatibility announcements.
