Give your users a personalized docs experience
userContext
variable to access the information you have sent to your docs. Here’s a simple example:
Hello, !
userContext
is only available after a user has logged in. For logged out users, the value of userContext
will be {}
. To prevent the page from crashing for logged-out users, always use optional chaining on your userContext
fields, e.g. {userContext.org?.plan}
groups
field in your page metadata.
When determining which pages to show to the user, Mintlify will check which groups the user belongs to.
If the user is not in any of the groups listed in the page metadata, the page will not be shown.
groups
in UserInfo and page metadata:
groups not in UserInfo | groups: [] in UserInfo | groups: ['admin'] in UserInfo | |
---|---|---|---|
groups not in metadata | ✅ | ✅ | ✅ |
groups: [] in metadata | ❌ | ❌ | ❌ |
groups: ['admin'] in metadata | ❌ | ❌ | ✅ |