@cassidyai/chat-deployment
v1.3.0
Published
```html <!DOCTYPE html> <html lang="en"> <head> <!-- ... --> </head> <body> <!-- ... -->
Downloads
149
Readme
Quickstart
<!DOCTYPE html>
<html lang="en">
<head>
<!-- ... -->
</head>
<body>
<!-- ... -->
<button id="open-modal" onclick="Cassidy.openModal()">
Open Cassidy Chat
</button>
<script src="https://unpkg.com/@cassidyai/chat-deployment@latest/dist"></script>
<script>
Cassidy.initialize({
key: "<YOUR_KEY>",
baseUrl: "https://app.cassidyai.com",
})
</script>
</body>
</html>Secure embeds
If your Cassidy embed deployment requires secure tokens, pass an authToken when
you initialize the SDK. Your app is responsible for fetching tokens from your
own backend (where you can validate the current user without exposing your
Cassidy API key in browser code) and refreshing them before they expire.
<script src="https://unpkg.com/@cassidyai/chat-deployment@latest/dist"></script>
<script>
Cassidy.initialize({
key: "<YOUR_KEY>",
baseUrl: "https://app.cassidyai.com",
authToken: "<AUTH_TOKEN>",
})
</script>When your app's auth layer mints a new embed token (for example, after the current one expires or the user's session is refreshed), pass it to the SDK:
Cassidy.setAuthToken("<NEW_AUTH_TOKEN>")