← Reference

Search engines need a search-only key in the browser

Master keys can rewrite and delete every index. Use a scoped key instead.

01

What it is

Meilisearch and Typesense both expect to be queried directly from the browser, which is why they issue more than one kind of key.

The master or admin key can read everything, change settings and delete indexes. A search-only key can run queries and nothing else. Only the second belongs in a bundle.

02

How to fix it

Generate a search-only key — for Meilisearch use the /keys endpoint with the "search" action; for Typesense create a search-only API key, optionally scoped to specific collections.

Put that key in your front end, keep the master key in server environment variables, and rotate the master key since it has been public.

03

How to confirm the fix

Try a write with the browser key — for example a settings update or a document delete. It must be rejected. If it succeeds, the key is still too powerful.

04

The mistake people make

Assuming a self-hosted instance is safe because the URL is obscure. If the browser can reach it, so can anyone who reads the bundle; there is no such thing as a private URL in client code.

Not sure whether this applies to you?

Give us the address and we will tell you. No code, no access, no install — and every finding we have is shown in full, including on the free trial.

Check a site