> For the complete documentation index, see [llms.txt](https://developers.tix.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.tix.xyz/getting-started/kyd-setup.md).

# Set up KYD Labs

TDP handles the marketplace side: custody, purchases, and listings. KYD Labs handles the fan side: who a ticket owner is, how they sign in, and the wallet their tickets live in. Every ticket owner is a KYD Labs fan, so parts of a resale integration run through KYD. This page says which parts, and what to get from KYD before you start.

## What each flow needs

| Flow                         | From TDP                                                                 | From KYD Labs                                                                      |
| ---------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| Discover events and listings | A sandbox API key                                                        | Nothing                                                                            |
| Buy a listing                | **Accept offers** permission, a registered integrator, a funded treasury | Nothing to build. To test a claim in sandbox, a test fan to claim with             |
| List a ticket                | **Create listings** permission                                           | An OAuth client for your app, and in sandbox a test fan who already holds a ticket |

Buying never touches KYD from your code. The recipient meets KYD once, when they open the claim link and sign in to receive their tickets.

Selling does. The ticket owner signs in to your app with KYD, their tickets come from the KYD Fan API, and they co-sign the listing through it. See [List a ticket for resale](/integration-guides/list-a-ticket.md).

## Get an OAuth client

If you sell, register an OAuth client for your app in the [KYD developer portal](https://developers.kydlabs.com) with:

* Your redirect URI, such as `https://your-app.example/auth/callback`. Register each origin you deploy to.
* The scopes `openid profile offline_access fan:tickets:read fan:listings:write`.
* The mode that matches your TDP key: `sandbox` with a sandbox key, `production` with a production key.

The client ID is public; there is no client secret. Sign-in, tokens, and the Fan API are documented at [docs.kydlabs.com](https://docs.kydlabs.com/).

## Get test fans and tickets

In sandbox, KYD provides test fans with a generated phone number and a fixed verification code; no SMS is sent. A test fan can hold tickets on test events. To exercise both flows you need:

* A test fan to act as the buyer, who opens a claim link and receives tickets.
* A test fan who already holds a ticket, to act as the seller.

Ask for these when you ask TDP for sandbox inventory.

## Keep the environments paired

TDP sandbox pairs with KYD sandbox mode, and TDP production with KYD production mode. A sandbox claim link can only be redeemed by a test fan, and a production one only by a real fan. Keep the TDP key and the KYD client for one mode together in your configuration.
