June 27, 2024
x
min read

Launch Week III Day 4: User Auth

Joshua Kim
Growth

Launch Week Day 4 brings **User Authentication** to your docs 🔒.

When writing documentation, you may want to limit which user guides are shown to your customers.

With User Auth, identify your users and tailor your docs content to them.

Why it matters

Customized portals allow for more relevant and contextualized documentation, making it easier for developers to find and understand the information they need.

User Authentication allows you to configure a way for authenticating your users into the documentation with user-specific identifiers.

For example, you can pre-fill API keys, show certain endpoints only for your enterprise customers, and surface specific guides for customers based on the products and features they are using.

This can help streamline the onboarding process, helping new developers get up to speed more quickly with your product.

Getting Started

Before your users can access personalized content, they must be authenticated. Mintlify supports two methods of authenticating users:

1. Shared Session: Utilize the same session token used by your dashboard to authenticate users.

2. JWT: Use your own login flow to send user info to your docs via a JWT in the URL.

When writing content, you can use the `userContext` variable to access the information you have sent to your docs. Here’s an example of how it would be implemented:

User Auth is an enterprise feature. {

 userContext.org === undefined

   ? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>

   : userContext.org.plan !== 'enterprise'

     ? <>You are currently on the ${userContext.org.plan ?? 'free'} plan. To speak to our team about upgrading, [contact our sales team](mailto:[email protected]).</>

     : <>To request this feature for your enterprise org, [contact our team](mailto:[email protected]).</>

If you would like to prefill keys in the API Playground, you can return the inputs in the user information. This allows for a way to navigate the API Reference without having to leave elsewhere to retrieve their API key.

To learn more about how to implement user authentication for your developer portal, check out our [documentation](https://mintlify.com/docs/integrations/user-auth/overview).

Next Steps

User Authentication is available for select enterprise organizations. Contact our sales team to get a demo today.

To stay updated for the last day of Launch Week, follow our Twitter/X or join our community!