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

# Custom Domain

> Route Bluvo API calls through your own domain using CNAME records and the customDomain SDK option

## Overview

By default, the Bluvo SDK sends requests to `api-bluvo.com`. The `customDomain` option lets you route traffic through your own domain instead (e.g., `bluvo.my-company.com`). Common reasons to do this:

* **Branding** — keep all API traffic under your own domain
* **Compliance** — satisfy internal policies that require first-party endpoints
* **Proxy control** — route through your own infrastructure for logging or access control

***

## DNS Setup

Create CNAME records pointing your subdomain to Bluvo's servers.

| Environment    | Your Record                 | Points To            |
| -------------- | --------------------------- | -------------------- |
| Production     | `bluvo.my-company.com`      | `api-bluvo.com`      |
| Test / Sandbox | `test-bluvo.my-company.com` | `test.api-bluvo.com` |

<Tip>
  Verify CNAME propagation before testing. You can check with `dig bluvo.my-company.com CNAME` or any DNS lookup tool. Propagation typically takes a few minutes but can take up to 48 hours depending on your DNS provider.
</Tip>

***

## CORS Configuration

No extra CORS setup is needed on your side. Bluvo's API accepts requests from CNAME'd origins automatically.

***

## SDK Configuration

The `customDomain` option in `BluvoFlowClientOptions` accepts three forms:

| Form               | Type                          | Behavior                                                  |
| ------------------ | ----------------------------- | --------------------------------------------------------- |
| Single string      | `string`                      | Used for both API and WebSocket connections               |
| Default literal    | `"api-bluvo.com"`             | No override — equivalent to omitting the option           |
| Separate endpoints | `{ api: string, ws: string }` | Different domains for API calls and WebSocket connections |

***

## Usage Example

```typescript theme={null}
import { useBluvoFlow } from "@bluvo/react";

function WithdrawalFlow() {
  const flow = useBluvoFlow({
    orgId: "org_xxx",
    projectId: "proj_xxx",
    apiKey: "pk_xxx",
    customDomain: "bluvo.my-company.com",
  });

  // ... rest of your withdrawal UI
}
```

If you need separate domains for API and WebSocket traffic:

```typescript theme={null}
const flow = useBluvoFlow({
  orgId: "org_xxx",
  projectId: "proj_xxx",
  apiKey: "pk_xxx",
  customDomain: {
    api: "bluvo-api.my-company.com",
    ws: "bluvo-ws.my-company.com",
  },
});
```

<Warning>
  Make sure your CNAME records are fully propagated before initializing the SDK with a custom domain. Requests will fail if the DNS records aren't resolving yet.
</Warning>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="State Machine Reference" icon="diagram-project" href="/learn/sdk/state-machine">
    Full list of states, transitions, hook booleans, and context data
  </Card>

  <Card title="Error Handling & 2FA" icon="triangle-exclamation" href="/learn/sdk/error-handling">
    Error recovery patterns and exchange-specific 2FA behavior
  </Card>

  <Card title="Encryption & Security" icon="shield-halved" href="/learn/security">
    How Bluvo encrypts and isolates exchange credentials
  </Card>

  <Card title="Code Samples" icon="code" href="https://github.com/bluvoinc/awesome/">
    Full working examples for Next.js, React, and more
  </Card>
</CardGroup>
