RUM Setup Skill
Use this skill to onboard an application to Coralogix Real User Monitoring (RUM): get a RUM API key, install the platform SDK, add the
call, and verify events land in the
dataset.
CLI Commands
| Command | Purpose |
|---|
cx iam api-keys list -o json
| List candidate keys and the team ID (no permissions in output) |
cx iam api-keys send-data-keys -o json
| List candidate send-data keys (no permissions in output) |
cx iam api-keys get <id> -o json
| Read a key's permissions () and value |
cx iam api-keys create --from-file <file>
| Create the RUM key (write - needs approval + ) |
| / | Current SDK install and init docs per platform |
cx dataprime query --source rum.events '<query>'
| Verify RUM events arrive |
| Profiles and regions - pick the active one for both key and |
and
take
to target a specific team.
and
are local commands - they take no
(
is an error).
Workflow
1. Detect the platform
Inspect the user's repo before anything else. Signals overlap (React Native apps also list
; Flutter and React Native repos contain
and
folders), so check
in this order and stop at the first match:
| # | Signal | Platform |
|---|
| 1 | | Flutter SDK - ignore its / folders |
| 2 | with (or ) | React Native SDK - ignore and native folders |
| 3 | with | Next.js (browser SDK, client-only init) |
| 4 | with a browser signal - , , , , a browser bundler (, , ), or an entry | Browser SDK () |
| 5 | / / | iOS SDK |
| 6 | with Android plugin | Android SDK |
A
alone (Node backend, tooling) is
not a browser app. If nothing matches, tell the user no supported client app was found instead of guessing.
2. Pick the profile - before any key operation
The key and the SDK domain must come from
one profile, so settle it before touching keys. The active profile is
if given, else
if set, else the
row of
- don't just read the
row. If there are several profiles and none was named,
ask the user which team the app belongs to now, then pass
to every
and
call that follows.
is that profile's
in upper case:
,
,
,
,
,
,
,
.
3. Get a RUM API key
RUM keys are
public by design - they ship inside client code. Create it with the
preset - the same key the UI's RUM flow creates. That preset grants exactly one permission,
, and is standalone: never add other presets or permissions. (Granting
directly also works but shows as a
key in the UI, so prefer the preset.) In Settings → API Keys a RUM key shows type "Send Your Data" with preset
. Do
not pick the
preset - it grants logs/metrics/spans ingest but not RUM, and makes the key secret, not public.
Reuse first. Check for an existing RUM key:
bash
cx iam api-keys list -p <profile> -o json
cx iam api-keys send-data-keys -p <profile> -o json
These listings don't include permissions, so treat every row as a
candidate only - never reuse a key based on its name. For each candidate run
cx iam api-keys get <id> -p <profile> -o json
and reuse it only if it is
active (
)
and has
as its only preset and no other permissions (or
as its only permission). Skip inactive keys - the SDK can't send with them. The value is in
(returned for unhashed keys - a hashed key can't be reused, create a new one).
Create one if none exists. This is a write - describe it to the user and get approval before passing
(same rules as
).
bash
cat > rum-key.json <<'EOF'
{
"name": "<app-name> RUM",
"owner": { "teamId": <team-id> },
"keyPermissions": { "presets": ["SendRUMData"], "permissions": [] },
"hashed": false
}
EOF
cx iam api-keys create --from-file rum-key.json -p <profile> --yes -o json
-
: read
from the step-2 profile's file
~/.cx/profiles/<profile>.toml
(written by
), or the
of any key in
cx iam api-keys list -o json
, or ask the user.
-
: RUM keys are Send-Your-Data (data-ingest) keys, so they need the
permissions, not the team custom-key ones:
- on → the role lacks
DATA-INGEST-API-KEYS:READCONFIG
(view keys);
- on or → the role lacks
DATA-INGEST-API-KEYS:MANAGE
( needs it too, since it returns the key value).
Don't retry with other payloads. Tell the user which permission is missing and ask them to get it, or to create it in
Settings → API Keys - key type
Send Your Data Key, role preset
only (or have an admin do it), then continue from step 4 with the key value.
-
keeps the key value retrievable later - fine for a public RUM key.
-
The response contains
- that is the
for the SDK.
4. Fetch the current SDK docs
SDK package names, versions, and options change - fetch them instead of guessing (see
):
bash
cx docs search "RUM SDK installation <platform>" --limit 5
cx docs fetch <suffix-from-search>
5. Install and initialize
Use the profile and
from step 2.
Browser example (confirm against the fetched docs):
bash
npm install @coralogix/browser
ts
import { CoralogixRum } from '@coralogix/browser';
CoralogixRum.init({
application: '<app-name>',
environment: 'production',
public_key: process.env.NEXT_PUBLIC_CX_RUM_KEY!, // or import.meta.env.VITE_CX_RUM_KEY
coralogixDomain: 'EU1',
version: '<app-version>',
});
Gotchas:
- Init once, as early as possible - the app entry point (, , root layout).
- Next.js: init only on the client - a component that calls in , rendered from the root layout. Never in server components.
- Env vars: keep the key in env config (, , ), not hard-coded. It is public, but env config makes rotation easy.
- should match the release - source maps and release comparison rely on it.
- Source maps (optional) are uploaded with and need a separate key - in the UI, key type Team Key with role preset (
source-mapping:ReadMapping
+ ) - never reuse the RUM key, and keep this one secret (CI only, not in client code). See cx docs fetch user-guides/rum/cli/rum-cli.md
(search doesn't surface it).
6. Verify data arrives (optional)
Setup is done once the key exists and
is in place - data only flows after the app runs and users hit it, and the SDK sends in batches. Give the user this query to run later, or run it now if they load the app:
bash
cx dataprime query --source rum.events \
"filter \$d.version_metadata.app_name == '<app-name>' | limit 10" -p <profile> -o json
No rows? Check the browser network tab for requests to the RUM ingress endpoint. Ad blockers, a wrong
, or a key with extra permissions are the usual causes.
Key Principles
- RUM key = preset only - nothing else on the key
- Reuse before create, and never pass without user approval
- Fetch SDK docs per platform with - don't hard-code versions or options from memory
- Client-side init only, once, at the app entry point
- Done = key + init in place - hand over the query for checking data later
Related Skills
- - general API key management
- - fetch platform-specific SDK docs
- - query RUM data once it flows