Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion references/api/api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,19 @@ createClient({
...
//other parameters
});
```
```

## Keeping Your API Key Secure

Your API key is sensitive — treat it like a password. It is tied to your account, controls your rate limits, and all requests made with it are attributed to you.

<Warning>
If your API key is leaked, unauthorized parties could consume your rate limits or make requests on your behalf. Contact us immediately if you suspect your key has been compromised and we will rotate it for you.
</Warning>

**Best practices:**

- **Keep it server-side only** — never expose it in client-side or frontend code. Use a [proxy API](#proxy-api) if calling Relay from the browser.
- **Use environment variables** — store your key in environment variables, not hardcoded in source code.
- **Don't commit it to version control** — add it to `.gitignore` or use a secrets manager.
- **Restrict access** — only share the key with team members who need it.