Keys and tokens
Publishable keys, secret keys, the DSN, scopes and how to rotate a key.
Create and revoke keys in Settings → API keys. A key is shown in full once, when it's created; after that only its prefix. Mendloop stores only a hash of each key.
The two kinds of key#
| Key | Looks like | Use it for | Safe to make public? |
|---|---|---|---|
| Publishable | pk_live_… pk_test_… |
SDKs in browsers and mobile apps. It can only send events (events:write). |
Yes. It ships inside your app. |
| Secret | sk_live_… sk_test_… |
The REST API (most endpoints), CI, the source-map CLI, server-side SDKs, the MCP server. | No. Keep it in a secret store or environment variable. |
The DSN#
The DSN is the publishable key plus where to send events:
https://pk_live_xxx@ingest.getmendloop.com/4242 is the project's ingest id. Copy the DSN from the project's settings (Settings → Projects and ingest).
On a self-hosted install it points at your own domain: https://<your domain>/<project number>.
Live and test keys#
Live and test mode are separate. A _test_ key sends to test mode, where nothing is written to your real repos,
trackers or channels. Use test keys in staging and for trying workflows. The key's mode also decides which data
the REST API returns. See Test and live mode.
Scopes for secret keys#
Give a secret key only the scopes it needs.
| Scope | Allows |
|---|---|
events:write |
Send errors and logs |
sourcemaps:write |
Upload source maps |
issues:read |
Read issues and root causes |
issues:write |
Change issues: assign, ignore, resolve, merge, triage; start root-cause analyses and fixes; create tickets |
projects:read / projects:write |
List projects / create and rename them |
audit:read |
Read the audit log |
releases:write and analytics:read can be chosen when you create a key, but nothing checks them yet, and there
is no endpoint to mark a deploy. There is no comment endpoint either, so issues:write doesn't cover comments.
What a secret key can't do#
Some REST endpoints refuse secret keys and need a signed-in session in the web app: approvals, connections, members, teams, policies, API keys, saved views and the live-update stream. Use the app for those. The API reference marks which endpoints take a key.
Whose permissions a key has#
A key acts with the role of the person who created it, limited by its scopes. It stops working when that person leaves the organization or their account is disabled, so create keys for CI from an account that will stay.
Rotating a key#
If a publishable key is abused, rotate it: create a new one, ship it in your next release, then revoke the old one. Only that project is affected.
Never paste a secret key into a chat, a ticket or a commit. Keep secret keys in your CI's secret store or in environment variables.