Let users log in for customized documentation experiences
user
variable.
groups
fields to your pages’ frontmatter. By default, every page is visible to every user.
Users will only see pages for groups
that they are in.
exp
claim, which determines when a JWT is considered invalid. Set the JWT exp
claim to a short duration (10 seconds or less) for security. Use expiresAt
for the actual session length (hours to weeks).groups
in their frontmatter are visible to this user.Example: User with groups: ["admin", "engineering"]
can access pages tagged with either the admin
or engineering
groups.MDX
content via the user
variable. Use this for dynamic personalization throughout your documentation.Basic example:MDX
:user
data, this would render as: Welcome back, Ronan! Your Enterprise plan includes…Advanced conditional rendering:user
is only available for logged-in users. For logged-out users, the value of user
will be {}
. To prevent the page from crashing for logged-out users, always use optional chaining on your user
fields. For example, {user.org?.plan}
.{ server: { subdomain: 'foo' } }
as an apiPlaygroundInputs
field. This value will be prefilled on any API page with the subdomain
value.header
, query
, and cookie
fields will only prefill if they are part of your OpenAPI security scheme. If a field is in either the Authorization
or Server
sections, it will prefill. Creating a standard header parameter named Authorization
will not enable this feature.Generate a private key.
Integrate Mintlify personalization into your login flow.
User
format. See the User data format section above for more information.docs.foo.com
. You want your docs to be separate from your dashboard (or you don’t have a dashboard) and enable personalization.Generate a JWT secret. Then create a login endpoint at https://foo.com/docs-login
that initiates a login flow to your documentation.After verifying user credentials:https://docs.foo.com#{SIGNED_JWT}
.https://docs.foo.com/page#jwt={SIGNED_JWT}&anchor={ANCHOR}
.Example:https://docs.foo.com/quickstart#step-one
https://docs.foo.com/quickstart#jwt={SIGNED_JWT}&anchor=step-one