---
title: Write keys
description: "What a source's write key looks like, who can see it, and how to keep it safe."
---

Every [source](https://omnibit.app/docs/cdp/get-started/key-concepts.md#source) has one write key. Your code will send
it with every event, so Omnibit knows which source and organization the event belongs to.

:::note
Omnibit doesn't receive events yet. Create your sources and store their keys now; the collector
and its SDKs are coming next.
:::

## Format

A write key is `omb_wk_` followed by 43 URL-safe base64 characters (32 random bytes). The fixed
prefix lets a secret scanner find leaked keys:

```regex
omb_wk_[A-Za-z0-9_-]{43}
```

## Who can see a key

| Source | Where the key lives | Shown in the console |
| - | - | - |
| Website or app (JavaScript, iOS, Android, React Native, Flutter) | In code your customers download, so anyone can read it | On the source's page, at any time |
| Server (Node.js, Python, Go, Java, PHP, Ruby, .NET, HTTP API) | On your servers only | Once, when the source is created or its key is rotated |

Omnibit stores only a hash of a server source's key, so nobody can read it again: not your team,
and not Omnibit.

## Keep a server key secret

* Store it in your secret manager or deployment environment, for example as
  `OMNIBIT_WRITE_KEY`, never in source code.
* Use a separate source, and so a separate key, for each server or service, so one leak doesn't
  affect the others.
* If a key is lost or may have leaked, [rotate it](https://omnibit.app/docs/cdp/guides/rotate-a-write-key.md). The old
  key stops working at once, with no overlap, so deploy the new one right away.

## Set up a source

The console shows setup steps for each platform on the source's page, under **Setup**. For a
website or app source they already contain its write key. For a server source they show
`YOUR_WRITE_KEY`: replace it with the key you stored, read from your environment.