This feature is available on Ultimate site plans.
How it works
Adaptive content works in one of two ways:- Passing data from your app to GitBook
- Passing data from authenticated access
Adaptive content is slightly different from authenticated access, although they can work together. While authenticated access allows you to protect your docs through a login, adaptive content customizes published material based on various authentication methods — including authenticated access or those from your own app.
What you can adapt
You can adapt and personalize many parts of your docs, including:- Hiding or showing pages
- Hiding or showing site variants
- Hiding or showing site sections
- Hiding or showing header links
- Adding personalized content to inline expressions
Working with the condition editor
The condition editor is where you’ll set the conditions for showing or hiding a page, variant, or section. After opening the condition editor, you’ll be able to write your condition as an expression that will run against data coming from visitors to your site.Example
The data you pass through your users to GitBook is attached to an object calledvisitor.claims.
Let’s take a look at an example if we want to write a conditional statement to only show a page for users who are part of a beta program:
isBetaUser is true in the user’s claim), will be able to see and access the page. Any user who does not match this claim (including visitors without any claims set), will not be able to see or access the page.
The condition editor also comes built in with autocomplete, which suggests claims or attributes that have been found on previous visitors to your site, helping you craft the conditional statement for your pages, variants, or sections.
Conditional pages
To launch the condition editor for a page, head to the actions menu next to a page, and click Add condition. You can also launch the condition editor from a page’s options. You can see which pages in your space have conditions set if the page has a page condition icon next to it.Conditional variants
To launch the condition editor for a variant, head to the actions menu next to a variant, and click Add condition. You can see which variants in your docs have conditions set if the variant has a page condition icon next to it.Conditional sections
To launch the condition editor for a section, head to the actions menu next to a section, and click Add condition. You can see which sections in your docs have conditions set if the section has a page condition icon next to it.Conditional page header links
To launch the condition editor for a page header link, head to the actions menu next to a header link, and click Add condition.Inline expressions
In addition to controlling the visibility of content, you can also use claims inline using expressions, just like page and space variables. To reference a claim inline using an expression, type/ in the editor, then select Expression. Claims will be accessible in the expression editor as properties on visitor.