Getting started

Keys

Rabolic's publishable keys (rb_pub_) for websites and apps and secret keys (rb_live_, rb_test_) for servers. Where to find them, how to create and revoke them, and their environments.

Every event is sent with a key. The key says which project the event belongs to, and which environment.

Two kinds of key

KindPrefixUse it inIt can
Publishablerb_pub_Websites and apps: the Web, React Native and Flutter SDKsSend events. Not revenue events
Secret, productionrb_live_Servers only: the Node.js SDK and the HTTP APISend events, identify people, and send revenue ($purchase, $renewal, $refund)
Secret, staging or developmentrb_test_Servers onlyThe 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."

  1. Open Integrations → API keys and choose Create key.
  2. Give it a name.
  3. Pick the Kind: Publishable or Secret.
  4. Pick the Environment: Production, Staging or Development.
  5. 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 with rb_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 runsSDKKey
Website@rabolic/webrb_pub_
React Native or Expo app@rabolic/react-nativerb_pub_
Flutter apprabolic_flutterrb_pub_
Node.js server@rabolic/noderb_live_ or rb_test_
Any other backendIngest HTTP APIrb_live_ or rb_test_