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

# Overview

> Introduction to the Lomadee TypeScript SDK for partner integrations

The Lomadee SDK (`@thelomadee/sdk`) is a TypeScript, ESM-only client for **partner integrations**. It lets your backend call Lomadee microservices with the credentials you receive during onboarding—without hand-rolling HTTP clients, auth headers, or per-service configuration.

<Warning>
  The SDK carries your `authKey`. Use it **only on the server** (API routes, workers, backend services). Never bundle it into browser or mobile client code.
</Warning>

## Who this is for

This documentation is written for **external developers and integration partners** building server-side automation against Lomadee partner services. Your Lomadee contact provisions an **`authKey`** scoped to your integration. Install `@thelomadee/sdk` from the public npm registry—no GitHub token is required.

If you are building against the public affiliate network REST API (brands, campaigns, channels, public orders), use the [Affiliate API](/api-reference/introduction) instead. That API authenticates with **`x-api-key`**. The SDK authenticates with your partner **`authKey`**, sent as the partner **`x-auth-key`** header on every request.

## What you get

One `Lomadee` instance exposes resource clients for the domains you integrate with. Request and response types are exported where the SDK defines them; some clients (notably `transactions`) return `Promise<unknown>` for certain methods—see each [reference page](/docs/sdk/reference/client).

| Property       | Purpose                                                                   |
| -------------- | ------------------------------------------------------------------------- |
| `transactions` | Create and manage orders                                                  |
| `commissions`  | Manage commission rules (when provisioned for your integration)           |
| `affiliates`   | List, create, and update affiliates                                       |
| `contents`     | Read content center items                                                 |
| `terms`        | Fetch the latest terms; `terms.acceptances` records and checks acceptance |

Each client maps to SDK methods and TypeScript types. Domain data shapes (request bodies, enums, response models) are importable from `@thelomadee/sdk/domains` when you need them outside a method call.

The SDK ships as **pure ESM** (`"type": "module"`). Import it with standard `import` syntax in TypeScript or JavaScript projects configured for ESM.

## How it fits your stack

```
Your server code
       │
       ▼
  new Lomadee({ authKey })
       │
       ├── transactions  ──► orders service
       ├── commissions   ──► commissions service
       ├── affiliates    ──► dashboard / auth services
       ├── contents      ──► dashboard service
       └── terms         ──► auth service
```

You do not configure service URLs yourself—the SDK selects the correct hosts for `production` (default) or `staging`. All requests share one authenticated HTTP client with a **10 second timeout**. There is no built-in retry, custom base URL option, or public interceptor API.

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/docs/sdk/quickstart">
    Install from npm, configure your `authKey`, and call
    `sdk.terms.latest()` from your backend
  </Card>

  <Card title="Environments and secrets" icon="key" href="/docs/sdk/guides/environments-and-secrets">
    Choose staging or production and store `authKey` safely in environment
    variables
  </Card>

  <Card title="How the SDK works" icon="sitemap" href="/docs/sdk/concepts/how-the-sdk-works">
    Understand the client layout, shared auth, and how resource clients map to
    services
  </Card>

  <Card title="Client reference" icon="book" href="/docs/sdk/reference/client">
    Configuration types, constructor options, and the root `Lomadee` class
  </Card>
</CardGroup>
