React component
Install with pnpm add @bootstrapware/answers. Import Answers from @bootstrapware/answers and the stylesheet once. The component uses hooks, so it belongs in a client boundary. Non-React pages use the Hosted script embed.
presentationdefaults tolauncher. Alsosection,modal, andwindow.defaultOpenopens modal, window, and launcher. They start closed otherwise.themeis optionallightordark. Omit it for the light cream default. The widget does not followprefers-color-scheme.pageContextis{ url, title }. Omit it and the widget sends the current URL and document title. It does not send the DOM.onFallbackruns for an unanswered result. The widget does not render an answer body for that outcome.suggestedQuestionsis a list of starter questions. Each one is a chip. Choosing a chip asks that question.shortcutopens the widget and focuses the question field.mod+kis Command on macOS and Control elsewhere.
Pass appId and publishableKey with no adapter and the component calls Hosted POST /api/v1/ask. createHostedAdapter is the same client if you want to build it yourself. Optional apiBaseUrl defaults to https://answers.bootstrapware.co. A publishable key without an app id does not fetch.
import { Answers } from "@bootstrapware/answers";
import "@bootstrapware/answers/styles.css";
<Answers
appId="ana_…"
publishableKey={process.env.NEXT_PUBLIC_BSW_ANSWERS_PUBLISHABLE_KEY}
suggestedQuestions={["What is your return window?", "How much is Hosted?"]}
shortcut="mod+k"
/>Related: Modes · React guide