Docs
Install guide
Everything you need to put your knowledge base in front of customers: the widget, its layouts and JavaScript API, the hosted help center, and the Answers API.
Quick start
Create a knowledge base, add a source, then open Widget in the dashboard. Turn the widget on, add your domain to the allowed list, and copy the snippet. Paste it before the closing </body> tag of every page that should show help.
<script
src="https://pagetruth.com/widget.js"
data-key="pk_your_public_key"
async
></script>The key starting pk_ is public by design: it identifies your knowledge base, and only answers on the domains you allow. Single-page apps only need it once, in the app shell.
Layouts
Choose the layout, side, colours, launcher and greeting in the dashboard. Every page that loads the snippet picks up the change.
panel— a full-height side panel, right or left. Best inside your app.bubble— a launcher in the corner that opens a compact popover. Best on marketing pages.modal— a centered search opened with ⌘K / Ctrl-K or the launcher. Best on docs sites.inline— renders inside an element on your page. See below.
To use a different layout on one page, set data-layout on the script tag.
<!-- Override the dashboard layout on one page -->
<script
src="https://pagetruth.com/widget.js"
data-key="pk_your_public_key"
data-layout="modal"
async
></script>Inline mount
Add an element with the data-pagetruth attribute where the assistant should appear, and give it a height. The widget fills it instead of floating above the page.
<div data-pagetruth style="height: 560px"></div>
<script
src="https://pagetruth.com/widget.js"
data-key="pk_your_public_key"
data-layout="inline"
async
></script>JavaScript API
Open the widget from your own UI — a Help menu item, a tooltip, an empty state — instead of, or as well as, the launcher. Calls made before the loader finishes are queued.
// The loader defines window.PageTruth once it has started.
PageTruth.open(); // open the panel, popover or search
PageTruth.close();
PageTruth.toggle();
PageTruth.ask('How do I export a board?'); // open and ask a question
// Wire it to your own Help button
document.querySelector('#help-button')
.addEventListener('click', () => PageTruth.open());Allowed domains
In Widget → Allowed domains, list every origin that may load your key, such as https://app.yourproduct.com. Requests from any other origin are refused, so nobody can copy your snippet and spend your answers. Add http://localhost:3000 while you develop.
Hosted help center
Turn on Help center in the dashboard and it is live at pagetruth.com/help/your-slug. On Growth and Scale, add a custom domain: create a CNAME for a subdomain such as help.yourproduct.com and the TXT record the dashboard shows, and we issue the certificate.
Answers API
On Growth and Scale, create a secret key in Settings → API keys. Keys start with sk_, are shown once, and must stay on your server. Send a question and receive the answer with its citations.
curl https://pagetruth.com/api/v1/answer \
-H "Authorization: Bearer sk_your_secret_key" \
-H "Content-Type: application/json" \
-d '{ "question": "How do I export a board to CSV?" }'{
"answer": "Open the board and choose Board → Export → CSV [1]. …",
"answered": true,
"citations": [
{
"index": 1,
"title": "Exporting a board to CSV",
"page": 1,
"quote": "Any board can be exported from Board → Export → CSV."
}
],
"conversationId": "4f1c…"
}Pass the returned conversationId with the next question to ask a follow-up. answered: false means the knowledge base had nothing relevant; show your own handoff in that case.
Limits
- Questions up to 1,000 characters; the last six turns of a conversation are used for follow-ups.
- Per visitor: 8 questions a minute and 60 a day. Per IP address: 30 a minute.
- Each answer counts against your plan’s monthly allowance; cached repeats and “not in the docs” replies do not.
Questions about an integration? Email hello@pagetruth.com or see the examples.