QuickHelp
QuickHelpClient from @cstar.help/js/quickhelp embeds contextual AI answers
wherever you have a question box. It searches your knowledge base, formulates an answer, and falls back
to "open a ticket" when it can't help.
Setup
setup.js
import { QuickHelpClient } from '@cstar.help/js/quickhelp';
const quickhelp = new QuickHelpClient({
teamSlug: 'acme',
// Optional: scope to test data with publishableKey: 'pk_test_...'
});Read public config
Each team configures whether QuickHelp is enabled and which categories to search. Read the live config before rendering your UI so you can hide the input if it's off.
config.js
const config = await quickhelp.config();
if (!config) {
// QuickHelp is disabled for this team
return null;
}
console.log(config.suggestedQuestions); // Display as starter promptsAsk a question
ask.js
const result = await quickhelp.ask({
question: 'How do I reset my password?',
// context: 'Page: /account/security' // Optional: improves the model's answer
});
console.log(result.answer); // The plain-language response
console.log(result.sources); // Articles the answer was drawn from
console.log(result.confidence); // 'high' | 'medium' | 'low'
if (result.confidence === 'low') {
// Show "still need help?" to open a chat ticket
}Wire it into your UI
Pair QuickHelp with the chat client for a graceful degradation: ask first, escalate to chat when the model returns low confidence or the user taps "talk to a human."