Let users log in for customized documentation experiences
Personalization lets you customize your documentation based on user information. This guide covers setup for each available handshake method.
Need help choosing? See the overview to compare options.
Select the handshake method that you want to configure.
Generate a private key.
Integrate Mintlify personalization into your login flow.
Modify your existing login flow to include these steps after user login:
User
format. See Sending Data for more information.Your documentation is hosted at 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}
.To redirect users to specific sections after login, use this URL format: 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
Generate a private key.
Integrate Mintlify personalization into your login flow.
Modify your existing login flow to include these steps after user login:
User
format. See Sending Data for more information.Your documentation is hosted at 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}
.To redirect users to specific sections after login, use this URL format: 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
Create user info API endpoint.
Create an API endpoint that:
User
format. See Sending Data for more information.Configure your OAuth personalization settings.
Configure your OAuth server.
Your documentation is hosted at foo.com/docs
and you have an existing OAuth server that supports the PKCE flow. You want to personalize your docs based on user data.
Create a user info endpoint at api.foo.com/docs/user-info
, which requires an OAuth access token with the docs-user-info
scope and responds with the user’s custom data:
Configure your OAuth server details in your dashboard:
https://auth.foo.com/authorization
ydybo4SD8PR73vzWWd6S0ObH
['docs-user-info']
https://auth.foo.com/exchange
https://api.foo.com/docs/user-info
Configure your OAuth server to allow redirects to your callback URL.
foo.com
, the API URL must start with foo.com
or *.foo.com
.dash.foo.com
, the API URL must start with dash.foo.com
or *.dash.foo.com
.foo.com
, your docs must be hosted at foo.com
or *.foo.com
.*.foo.com
, your docs must be hosted at foo.com
or *.foo.com
.Create user info API endpoint.
Create an API endpoint that:
User
format (see Sending Data)Access-Control-Allow-Origin
header (must not be *
).Access-Control-Allow-Credentials
header to true
.Only enable CORS headers on this specific endpoint, not your entire dashboard API.
Configure your personalization settings
You have a dashboard at dash.foo.com
, which uses cookie-based session authentication. Your dashboard API routes are hosted at dash.foo.com/api
. You want to set up personalization for your docs hosted at docs.foo.com
.
Setup process:
dash.foo.com/api/docs/user-info
that identifies users via session authentication and responds with their user data.Access-Control-Allow-Origin
: https://docs.foo.com
Access-Control-Allow-Credentials
: true
https://dash.foo.com/api/docs/user-info
.You have a dashboard at dash.foo.com
, which uses cookie-based session authentication. Your dashboard API routes are hosted at dash.foo.com/api
. You want to set up personalization for your docs hosted at foo.com/docs
.
Setup process:
dash.foo.com/api/docs/user-info
that identifies users via session authentication and responds with their user data.Access-Control-Allow-Origin
: https://foo.com
Access-Control-Allow-Credentials
: true
https://dash.foo.com/api/docs/user-info
.You have a dashboard at foo.com/dashboard
, which uses cookie-based session authentication. Your dashboard API routes are hosted at foo.com/api
. You want to set up personalization for your docs hosted at foo.com/docs
.
Setup process:
foo.com/api/docs/user-info
that identifies users via session authentication and responds with their user data.https://foo.com/api/docs/user-info
No CORS configuration is needed since the dashboard and docs share the same domain.