DocsOther systemsConnect a custom application
Connect a custom application
You tell us where your application runs. Your developer adds the chat and the signed user token.
Contact us. We create your standalone Codexta account by hand.
Tell us every address your application runs on, such as
https://app.example.com. Test and live are separate addresses. Only https works.Keep the welcome email. It holds your account name, your signing secret and the script address. The secret is shown once.
Send the email and the box below to your developer. They follow Signed user token.
Open your application. The chat button appears. Sign in and check the chat knows who you are.
Open the admin link from the welcome email and press Set up my assistant.
What Codexta needs from your application
| Need | Why |
|---|---|
| A backend that knows its signed-in users and can keep a secret | It signs a short token that tells Codexta who is chatting. |
| The exact https addresses of your pages | The chat only loads and answers on these. |
| One small page on your own server | The widget asks it for the token before each request. |
For your developer
Add this to every page where the chat should show. Replace the script address and account name with the values from the welcome email.
<script src="https://CODEXTA_HOST/widget.js" async></script>
<script>
window.addEventListener('load', function () {
CodextaWidget.init({
channel: 'custom',
tenant: 'your-account-name',
getHostToken: async function () {
try {
const r = await fetch('/codexta/token', {credentials: 'same-origin'});
if (!r.ok) return null;
return (await r.json()).token || null;
} catch (e) { return null; }
}
});
});
</script>Tip. Codexta keeps the user id, email and name from the token. Records such as accounts or orders are not stored; they are looked up when needed. What the assistant can do inside your application is built with Codexta for your application.
NextSigned user tokenWas something unclear? Contact support