Skip to content
AI Support / Dev Center

10 results · Esc to close

Documentation/Start here

GETTING STARTED

Start here

From authenticated session to first context-aware conversation.

Try the widget

Download and extract the starter. With Node.js 22 or higher, run the command below in the extracted directory and open the address shown in the terminal. Open the chat and ask why the import failed. The response uses sample dummy data.

Shell
node server.mjs

01 · Connect your app

Create a free workspace. In Staging, add your app’s domain and verify the TXT DNS record. Generate the integration credential and save it to your backend’s private environment. Use Production for publishing with a separate project and credential.

The tenant ID identifies your project on the platform. It does not replace the organization or store of the user within your application.

02 · Request session

Your backend authenticates the person and checks current links and permissions before calling the issuer. The credential determines the tenant; the request does not accept a free tenant.

cURL
# Somente no backend. Use variáveis do ambiente privado.
curl --fail-with-body \
  https://support-ai.pontes.uk/api/widget/sessions \
  -H "Authorization: Bearer $SUPPORT_INTEGRATION_CREDENTIAL" \
  -H "Content-Type: application/json" \
  -d '{"userId":"usr_exemplo","userEmail":"","userRoles":["member"],"plan":"standard"}' 

03 · Prepare context

Collect userState, userHistory, and userLogs for the same person. Return session and context via your application’s authenticated endpoint, with Cache-Control: no-store. This bootstrap endpoint belongs to your backend.

  • Use the official schema and synthetic data in the first test.
  • Do not send credentials, headers, or logs from other people.
  • A failed collection must return an error; do not invent an empty list.

04 · Mount and check widget

Carregue o SDK fixado 0.3.2, implemente renovação e destruição da instância. Confirme uma resposta real e o snapshot correspondente antes de liberar.

JavaScript
// Depois de autenticar e revalidar a pessoa no seu backend.
// Estes callbacks são implementados pelo seu aplicativo.
const data = await fetchAuthenticatedBootstrap();
const widget = AISupportWidget.init({
  apiUrl: 'https://support-ai.pontes.uk',
  tenantKey: data.tenantKey,
  jwt: data.jwt,
  context: data.context,
  locale: data.locale,
  theme: 'light',
  position: 'bottom-right',
  onTokenRefresh: async () =>
    (await fetchAuthenticatedBootstrap()).jwt,
  onOpen: async () =>
    widget.updateContext(await fetchAuthorizedContext()),
});
// No logout, troca de pessoa/organização/papel e unmount:
// widget.destroy();
CONTINUE HEREAuthentication