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.