QuickHelp

QuickHelpClient from @cstar.help/js/quickhelp answers a visitor's question from your published help content and tells you which articles it used. When your help content does not cover the question, it says so and offers the contact options you set in Settings, instead of guessing.

Setup

setup.js
import { QuickHelpClient } from '@cstar.help/js/quickhelp';

const quickhelp = new QuickHelpClient({
  teamSlug: 'acme',
  // Optional: answer from test articles with publishableKey: 'pk_test_...'
});

Read public config

config() returns the header, placeholder and theme your team set for Quick Help, or null when Quick Help is off. Read it before rendering so you can hide the input.

config.js
const config = await quickhelp.config();
if (!config) {
  // Quick Help is off for this team
  return null;
}

console.log(config.headerTitle, config.placeholderText);

Ask a question

ask.js
const result = await quickhelp.ask({ question: 'How do I reset my password?' });

console.log(result.answer);   // Light markdown, from your help content only
console.log(result.sources);  // [{ title, url }] the answer used, [] when not covered
                              // url is null when the source has no public page

// Pass the session id back on follow-up questions
const next = await quickhelp.ask({
  question: 'And if the email never arrives?',
  sessionId: result.sessionId
});

How answers stay factual

  • Quick Help reads only articles that are visible to customers and in Published status, plus the websites you add as Atlas sources. Drafts, team-only articles and hidden categories are left out in code before any model sees them.
  • If a search finds nothing, Quick Help does not call the model at all. You get a fixed reply that the help content does not cover the question, plus your contact options, and turnOutcome is 'escalated'.
  • sources lists the articles and pages the answer was drawn from. Article links point at your verified custom help domain or your cStar help center. A source with no public page (public library off, or a test article) has url: null, so show its title as text.
  • Quick Help cannot open tickets, look up customers or hand off to a person. Replies that claim to (for example "I've escalated this") are replaced with your contact options.
  • It runs on your own OpenRouter key and model, at the lowest temperature the model allows. An answer cut off at the length cap is never shown; you get the sources instead. A model can still misread an article, so show the sources.

Wire it into your UI

Show result.sources as links under the answer. When result.turnOutcome === 'escalated', the answer already points to your contact options; you can also offer the chat client as a next step.

ui.js
renderAnswer(result.answer);
renderSourceLinks(result.sources);

if (result.turnOutcome === 'escalated') {
  showTalkToUsButton(); // e.g. open your chat widget
}

Next up