Keys
Every event is sent with a key. The key says which project the event belongs to, and which environment.
Two kinds of key
| Kind | Prefix | Use it in | It can |
|---|---|---|---|
| Publishable | rb_pub_ | Websites and apps: the Web, React Native and Flutter SDKs | Send events. Not revenue events |
| Secret, production | rb_live_ | Servers only: the Node.js SDK and the HTTP API | Send events, identify people, and send revenue ($purchase, $renewal, $refund) |
| Secret, staging or development | rb_test_ | Servers only | The same as rb_live_ |
- A publishable key is public by design. Anyone can read it from your site or app. That is why it can't send revenue.
- A secret key must never ship in a browser or an app. The browser, React Native and Flutter SDKs refuse secret keys. The Node.js SDK refuses publishable keys.
Where to find them
In the dashboard, open your project, then Integrations → API keys.
- Publishable keys are shown in full, with a Copy button.
- Secret keys are shown only by their first characters. The full key is shown once, when you create it.
A new project already has a publishable key called "Default", for production.
Create a key
Owners and admins can create keys. Others see "Keys are managed by the organization's owners and admins."
- Open Integrations → API keys and choose Create key.
- Give it a name.
- Pick the Kind: Publishable or Secret.
- Pick the Environment: Production, Staging or Development.
- Copy the key. For a secret key, store it now: it isn't shown again.
Environments
The environment is stored with the key. Events take it from the key; SDKs don't send it.
- Use a staging or development key in your test builds, so test events stay out of production reports.
- The filter bar at the top of the reports has an environment select: Production, Staging, Development. Reports show Production unless you change it.
- Secret keys for production start with
rb_live_. Secret keys for staging and development start withrb_test_.
Revoke a key
In Integrations → API keys, choose Revoke on the key. It stops working on its next request. An SDK that gets 401 invalid_key stops sending for the rest of the process lifetime and keeps its queue.
Which key goes where
| Where the code runs | SDK | Key |
|---|---|---|
| Website | @rabolic/web | rb_pub_ |
| React Native or Expo app | @rabolic/react-native | rb_pub_ |
| Flutter app | rabolic_flutter | rb_pub_ |
| Node.js server | @rabolic/node | rb_live_ or rb_test_ |
| Any other backend | Ingest HTTP API | rb_live_ or rb_test_ |
Quickstart
Create a Rabolic account and project, get your key, install an SDK with npx rabolic init, and see your first event on the Live page.
Setup CLI
npx rabolic init detects your project, installs the right Rabolic SDK, adds one file, sets the key and sends a test event. What it does for Next.js, Nuxt, Vite, Node.js, Expo, React Native, Flutter and static sites.