Chatbot Plugin
The Chatbot plugin provides conversational flows for job applications and other interactions.Installation
- npm
- pnpm
- CDN
Basic usage
- Package
- CDN
Configuration
Theme
Feedback integration
Collect feedback after conversations:Custom terms
Override default UI text. Common keys includesend, skip, undo, maximize, minimize, close_application, upload_file, address_search, and various validation_* messages.
API
prepare()
Preloads UI assets. Optional but recommended to avoid delays.
open(flow)
Opens the chatbot with a flow (or a promise that resolves to a flow).
close()
Closes the chatbot UI and clears the in-memory flow state. The widget stays in the DOM and can be reopened with open().
destroy()
Fully tears down the chatbot — unmounts the UI, removes the DOM element, and resets all runtime state. Use this when the widget is no longer needed on the current page. After destroy(), call prepare() to re-initialise.
fetchFlowByJobId(jobId, options?)
Fetches a conversation flow for a specific job. By default, the jobId is treated as the external (ATS) ID.
| Option | Type | Description |
|---|---|---|
idType | 'inploi' | 'ats' | ID type (default ats) |
context | Record<string, unknown> | Key-value variables available to the flow |
analytics | { customProperties?: Record<string, unknown> } | Custom data forwarded to analytics events |
locationOrigin | { lat?: number, lng?: number } | Coordinates for sorting address suggestions by proximity |
fetchFlowById(flowId, options?)
Fetches a conversation flow by its ID. Accepts the same options as fetchFlowByJobId (except idType).
Soft navigation
If your site uses client-side navigation (e.g. Turbo, HTMX, SPA routers), the chatbot’s DOM can be removed without it knowing. Usedestroy() before the page content is replaced, and re-initialise on the new page.
- Turbo / Turbolinks
- HTMX (hx-boost)
- SPA routers
inploi.ready() is a DOM-ready helper — it replaces document.addEventListener('DOMContentLoaded', ...) for the initial page load. It does not replace framework-specific navigation hooks like turbo:load or htmx:afterSettle.