Keys
Ingest keys only write and are public by design; server, read and admin keys stay on a server.
A key belongs to one project and has one of four scopes. Its prefix says which.
| Scope | Prefix | Dashboard name | What it can do | Where it lives |
|---|---|---|---|---|
| Ingest | lyr_ing_ | Send events | Append events, nothing else | Inside your app or your web page |
| Server | lyr_srv_ | Send events from a server | Append events, nothing else. Its events are verified. | Your backend only. Keep it secret. |
| Read | lyr_read_ | Read events | Query events | A server or a script. Keep it secret. |
| Admin | lyr_adm_ | Full access | Send events and query them, for administration jobs | A server. Keep it secret. |
A read key queries its project's events through the read API: from a script, a notebook or an agent on a server. It reads everything the project holds, so it never goes in an app or a web page.
A server key sends events from your backend: from the Node, Python, Go or JVM SDK, or with curl.
It can't read, like an ingest key, but it is a secret: the events it sends are marked
verified, because only your servers hold it, and one address
isn't limited to a daily share of the month with it. It never goes in an app or a web page. Apps
and web pages use the ingest key.
Why an ingest key can be public
An ingest key ships inside your app binary or your web page, so assume anyone can read it. That is
fine because it can only append events to its project: it can't read, change or delete anything.
The project an event lands in always comes from the key, never from the event. To limit abuse,
each project is rate-limited (60,000 events a minute by default), and a batch over the limit gets 429.
One address may also send only a daily share
of the organization's month with it.
The flip side: anyone holding the ingest key can send events like your app's, so they aren't verified, unless they come from your Apple app and Apple proves it with App Attest, or from your Android app and the phone proves it with Key Attestation. Those events don't count toward the daily share either.
Keys are shown once
Lyrelog stores only a SHA-256 hash of each key. You see the key once, when you create it: copy it then. Lost keys can't be recovered; make a new one.
Creating and revoking
Keys live on the project's API keys page: Settings, then API keys, or ⌘ K and API keys. Only owners can create and revoke them.
- A project has at most 20 active keys. Revoke one to make another.
- Keys don't expire: a key works until it's revoked, or until its project is deleted.
- Making a Send events from a server, Read events or Full access key needs a recent sign-in (within 10 minutes). Send events keys don't.
- When someone leaves an organization or is removed, the read and full-access keys they made are revoked. Ingest keys stay, because apps already out there send with them. Server keys stay too, because your servers send with them: if the person who left saw one, revoke it and replace it.
- Everyone in the organization sees the list of keys and when each was last used.
A revoked key stops working at once; allow up to a minute. An SDK that gets 401 or 403 stops sending until
the app restarts, and keeps its queued events.