Keys / Typesense
TYPESENSE_API_KEY
The bootstrap admin key a self-hosted Typesense server starts with. Apps also use the name for a key made with /keys or Typesense Cloud.
- Expires
- the bootstrap key never; others when you set
expires_at - API
- create, list and delete, with an admin key or the Cloud Management API
Get it
Create one on cloud.typesense.org. The steps aren't recorded yet.
Set it
TYPESENSE_API_KEY=...
The Typesense server reads it at launch, as it reads --api-key. The client libraries don't; your app passes the key in as apiKey or api_key. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Typesense recommends using the bootstrap key only to create other keys. Create an admin key with
/keysfor daily use, so you can rotate and revoke it. - On Typesense Cloud, Typesense manages the bootstrap key; Generate API Keys in the cluster dashboard creates an admin and a search-only key.
- Create a key with the same
actions,collectionsand expiry as the old one. Its value is shown only in the create response. - Deploy it everywhere that reads
TYPESENSE_API_KEY. Check that nothing still uses the old key, then delete it withDELETE /keys/<id>. - To change a self-hosted bootstrap key, restart the server with a new
--api-keyorTYPESENSE_API_KEY.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.