Generating tenant tokens without a library is possible, but not recommended. This guide summarizes the necessary steps. The full process requires you to create a token header, prepare the data payload with at least one set of search rules, and then sign the token with an API key.Documentation Index
Fetch the complete documentation index at: https://www.meilisearch.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Prepare token header
The token header must specify aJWT type and an encryption algorithm. Supported tenant token encryption algorithms are HS256, HS384, and HS512.
Build token payload
First, create a set of search rules:uid field to obtain your API key’s UID:
Encode header and payload
You must then encode both the header and the payload intobase64, concatenate them, and generate the token by signing it using your chosen encryption algorithm.
Make a search request using a tenant token
After signing the token, you can use it to make search queries in the same way you would use an API key.Next steps
Tenant token payload reference
Detailed reference for all fields in the tenant token payload.
Generate tokens with an SDK
Use a Meilisearch SDK to generate tenant tokens with less manual work.
Generate tokens with a third-party library
Create tenant tokens using JWT libraries like jsonwebtoken.