This guide shows you the main steps when creating tenant tokens usingDocumentation Index
Fetch the complete documentation index at: https://meilisearch-6b28dec2-webhook-doc-update.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
node-jsonwebtoken, a third-party library.
Requirements
- a working Meilisearch project
- a JavaScript application supporting authenticated users
jsonwebtokenv9.0
Generate a tenant token with jsonwebtoken
Build the tenant token payload
First, create a set of search rules:uid field to obtain your API key’s UID:
Create tenant token
First, includejsonwebtoken in your application. Next, assemble the token payload and pass it to jsonwebtoken’s sign method:
sign requires the payload, a Meilisearch API key, and an encryption algorithm. Meilisearch supports the following encryption algorithms: HS256, HS384, and HS512.
Your tenant token is now ready to use.
Though this example used
jsonwebtoken, a Node.js package, you may use any JWT-compatible library in whatever language you feel comfortable.