01 — Quickstart . Four steps, one config, zero backend. Harque reads your published pages, keeps an insider index, and answers visitors from both.
Install the widget — npm install @harque/widget. Create harque.config.json in your project root. Add the custom script tag to your site template. Create an API key in the dashboard and reference it in your config. Heads up: you can also skip npm entirely and use the data-attribute script tag below — the assistant runs in a couple of kilobytes.
02 — npm install . The widget package bundles the assistant, the walking H, and the insider indexer. It ships as an ES module with zero runtime dependencies.
terminal Copy
# inside your project root
npm install @harque/widget Then import it where your app mounts:
app.js Copy
import { Harque } from '@harque/widget' ;
Harque.init(); // reads harque.config.json automatically 03 — Config file . Create harque.config.json at the root of your project. Harque picks it up on boot — no wiring required.
harque.config.json Copy
{
"apiKey" : "hk_live_xxxx" ,
"siteId" : "your-site-slug" ,
"position" : "bottom-right" ,
"character" : "walker" ,
"theme" : {
"accent" : "#6e2330" ,
"paper" : "#fff6ec" ,
"ink" : "#2f3c36"
},
"index" : [ "/" , "/pricing" , "/docs" ]
} Note: the API key can also live in an environment variable — HARQUE_API_KEY wins over the file.
04 — Script tag . No build step? Add the custom script tag to your site template. Everything is configured inline.
index.html Copy
<script src = "https://cdn.harque.ai/widget.js"
data-harque-key = "hk_live_xxxx"
data-harque-site = "your-site-slug"
data-harque-position = "bottom-right"
data-harque-character = "walker"
defer > </script > Or initialise it in JavaScript app.js Copy
import { Harque } from '@harque/widget' ;
Harque.init({
apiKey : 'hk_live_xxxx' ,
siteId : 'your-site-slug' ,
character : 'santa-house' ,
onAsk : (q) => analytics.track(q)
}); 05 — API keys . Create a key in the dashboard, then reference it in your config or as an environment variable. Keys are scoped per site and can be rotated at any time.
Log in and open Dashboard → API keys . Create a key named after the environment (staging, production). Export it — export HARQUE_API_KEY="hk_live_xxxx". Restart your app. Harque validates the key on first boot. .env Copy
HARQUE_API_KEY= hk_live_xxxx
HARQUE_SITE_ID= your-site-slug Security: keys starting with hk_live_ are production secrets — keep them server-side or in your build environment, never in client code.
06 — Characters . Harque ships with a small studio of animated characters. Point character at any of these:
Character Description walker The walking H — strolls and blinks, invites conversation. attachment A swinging paperclip for questions, files, and follow-ups. santa-house A house with a white mustache roof, eyes, and a smile below. bell A polite ring when a visitor waits. bolt Flashes the instant Harque starts composing. bubble A thinking bubble with blinking eyes.
07 — API reference . Every endpoint is served from https://api.harque.ai. Authenticate with Authorization: Bearer hk_live_xxxx.
Method / path Description POST /v1/chat Send a visitor message; returns the assistant answer and intent. POST /v1/index Queue a page (or sitemap) for indexing. GET /v1/analytics Top asks, struggle maps, missing info, geography. GET /v1/requests Paginated request log for the dashboard. POST /v1/keys Create an API key. DELETE /v1/keys/:id Revoke and rotate a key.