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

# Quickstart

> From install to your first contact in a few minutes.

**1. Create an API key**

In the CRM, open **Settings → API keys** and create a key. It starts with `gd_key_` and is shown once, so store it as a secret, for example `CRM_API_KEY`.

> [!WARNING]
>
> The key can write to your workspace. Use it only from your backend, never in a browser.

**2. Install the SDK**

```bash npm theme={null}
npm install @revenuebee/sdk
```

```bash pnpm theme={null}
pnpm add @revenuebee/sdk
```

**3. Create a client**

```ts theme={null}
import { createClient } from "@revenuebee/sdk";

export const crm = createClient({
  apiKey: process.env.CRM_API_KEY!,
  baseUrl: "https://crm.example.com",
});
```

**4. Send a contact**

Call this wherever a user signs up or changes their details. It is safe to call every time.

```ts theme={null}
const [contact, error] = await crm.contacts.upsert({
  dbId: user.id,
  name: user.name,
  emails: [user.email],
});

if (error) {
  console.error(error.code, error.message);
}
```

> [!TIP]
>
> Already sent this customer? Look them up with [`contacts.resolve`](https://docs.revenuebee.ai/sdk/resolve-contact) instead.
> Faster still: save `contact.id` in your own database the first time, and pass it as `partyId` from then on. No lookup needed.

**5. Record what they do**

```ts theme={null}
// every call after contacts.upsert names the contact by the id it returned
await crm.events.add({ partyId: contact.id, name: "project.created", properties: { plan: "pro" } });
```


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