Skip to content

Testing your integration

Use the staging ID and https://staging.chatbot.tiketo.cloud on your staging site. Tiketo can allow an agreed http://localhost:<port> or http://127.0.0.1:<port> origin for that ID. Production IDs accept only production origins.

Replace the client ID and origin with the exact values you will use, then run:

Terminal window
curl -sS -o /dev/null -w '%{http_code}\n' \
-H 'Origin: http://localhost:5173' \
https://staging.chatbot.tiketo.cloud/config/TC-XXXXXXXX.json

Expect 200 for an allowed scheme, host, and port. A valid client ID returns 403 when the origin is not allowed. Other results usually point to the wrong ID or endpoint. Opening the URL directly is not the same test because browser navigation omits the page’s Origin header.

  1. Confirm the config request returns 200 from the intended page origin.
  2. Confirm the launcher appears and opens.
  3. Trigger every supplied action and assert the real host effect plus its returned shape.
  4. Trigger every host component, exercise keyboard interaction, reply once, and navigate away to prove cleanup.
  5. Test CSP with browser console reporting enabled.
  6. Test logout with await tiketoChat("reset"). Force one reset failure and confirm that the host still logs out, hides the launcher, and reports the error. For an immediate account switch, set the new context before using { relaunch: true }.

Keep business behavior in ordinary functions and register a thin adapter. Test the function directly.

export function currentRoute(): { route: string } {
return { route: window.location.pathname };
}
tiketoChat("action", "whereAmI", currentRoute);
// Unit test
history.replaceState({}, "", "/checkout");
expect(currentRoute()).toEqual({ route: "/checkout" });

For a component, export the renderer and pass it a detached document.createElement("div"). Spy on reply. Check payload escaping, one intended UI reply, and the returned cleanup. The embed enforces one-shot delivery and contract validation.

The password-protected Tiketo demo is the reference implementation. Ask your Tiketo contact for access when you need to compare behavior.