@paramms/chat-widget 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -13
- package/dist/annotations.d.ts +11 -0
- package/dist/chatlist.d.ts +28 -4
- package/dist/chatlist.js +63 -51
- package/dist/chatlist.js.map +1 -1
- package/dist/core.d.ts +77 -0
- package/dist/core.js +146 -0
- package/dist/core.js.map +1 -0
- package/dist/e2e.js +1608 -0
- package/dist/e2e.js.map +1 -0
- package/dist/hooks.d.ts +61 -0
- package/dist/hooks.js +74 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.html +176 -0
- package/dist/react.d.ts +68 -26
- package/dist/react.js +266 -233
- package/dist/react.js.map +1 -1
- package/package.json +6 -24
package/dist/index.html
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Relay Chat Widget</title>
|
|
7
|
+
<style>
|
|
8
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
9
|
+
html, body { height: 100%; }
|
|
10
|
+
body {
|
|
11
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
12
|
+
min-height: 100vh;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
padding: 24px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Marketing mode (no profileId in URL): purple gradient + info column */
|
|
20
|
+
body.marketing {
|
|
21
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
22
|
+
}
|
|
23
|
+
.container {
|
|
24
|
+
max-width: 900px;
|
|
25
|
+
width: 100%;
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 48px;
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
}
|
|
30
|
+
.info { flex: 1; color: #fff; }
|
|
31
|
+
.info h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
|
|
32
|
+
.info p { font-size: 16px; opacity: .85; line-height: 1.6; margin-bottom: 24px; }
|
|
33
|
+
.snippet {
|
|
34
|
+
background: rgba(0,0,0,.3);
|
|
35
|
+
border-radius: 12px;
|
|
36
|
+
padding: 20px;
|
|
37
|
+
font-family: 'SF Mono', 'Fira Code', monospace;
|
|
38
|
+
font-size: 13px;
|
|
39
|
+
color: #e2e8f0;
|
|
40
|
+
line-height: 1.6;
|
|
41
|
+
white-space: pre;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Widget-only mode (?profileId=... present): bare contained card on a
|
|
45
|
+
neutral backdrop — what the widget actually looks like embedded on a
|
|
46
|
+
real page, just centered for easy viewing/sharing as a test link. */
|
|
47
|
+
body.widget-only { background: #e9eaee; }
|
|
48
|
+
|
|
49
|
+
/* Both modes use the same card shape for the widget itself */
|
|
50
|
+
.preview {
|
|
51
|
+
width: 390px;
|
|
52
|
+
height: 680px;
|
|
53
|
+
max-width: calc(100vw - 48px);
|
|
54
|
+
max-height: calc(100vh - 48px);
|
|
55
|
+
border-radius: 22px;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
box-shadow: 0 24px 60px rgba(0,0,0,.25);
|
|
58
|
+
background: #fff;
|
|
59
|
+
flex-shrink: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#app { width: 100%; height: 100%; }
|
|
63
|
+
</style>
|
|
64
|
+
</head>
|
|
65
|
+
<body>
|
|
66
|
+
<div id="marketing-info" class="info" style="display:none">
|
|
67
|
+
<h1>Relay Chat Widget</h1>
|
|
68
|
+
<p>Add a real-time chat widget to any website in two lines of code.</p>
|
|
69
|
+
<div class="snippet"><div id="chat"></div>
|
|
70
|
+
<script type="module">
|
|
71
|
+
import { mount } from 'https://relay.paramms.com/index.js'
|
|
72
|
+
mount({
|
|
73
|
+
el: document.getElementById('chat'),
|
|
74
|
+
url: 'wss://api.paramms.com/ws',
|
|
75
|
+
profileId: 'YOUR_PROFILE_ID',
|
|
76
|
+
})
|
|
77
|
+
</script></div>
|
|
78
|
+
</div>
|
|
79
|
+
<div id="layout"></div>
|
|
80
|
+
<script type="module">
|
|
81
|
+
import { mount } from './index.js'
|
|
82
|
+
|
|
83
|
+
const q = new URLSearchParams(location.search)
|
|
84
|
+
const profileId = q.get('profileId')
|
|
85
|
+
const isWidgetOnly = !!profileId
|
|
86
|
+
|
|
87
|
+
document.body.className = isWidgetOnly ? 'widget-only' : 'marketing'
|
|
88
|
+
|
|
89
|
+
const layout = document.getElementById('layout')
|
|
90
|
+
const preview = document.createElement('div')
|
|
91
|
+
preview.className = 'preview'
|
|
92
|
+
const app = document.createElement('div')
|
|
93
|
+
app.id = 'app'
|
|
94
|
+
preview.append(app)
|
|
95
|
+
|
|
96
|
+
if (isWidgetOnly) {
|
|
97
|
+
// Just the contained card, centered on a neutral backdrop.
|
|
98
|
+
layout.append(preview)
|
|
99
|
+
} else {
|
|
100
|
+
// Marketing landing page: info column + card preview, side by side.
|
|
101
|
+
const container = document.createElement('div')
|
|
102
|
+
container.className = 'container'
|
|
103
|
+
const info = document.getElementById('marketing-info')
|
|
104
|
+
info.style.display = ''
|
|
105
|
+
container.append(info, preview)
|
|
106
|
+
layout.append(container)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const wsUrl = q.get('url') || 'wss://api.paramms.com/ws'
|
|
110
|
+
const subjectId = q.get('subjectId') || undefined
|
|
111
|
+
|
|
112
|
+
// ── Persistent guest identity ────────────────────────────────────────────
|
|
113
|
+
// Resolved here and persisted via BOTH a first-party cookie and localStorage.
|
|
114
|
+
// On this top-level page the cookie survives refreshes even when localStorage
|
|
115
|
+
// is cleared/blocked, so the guest keeps the same id across reloads and the
|
|
116
|
+
// server resumes their existing conversation instead of starting a new chat.
|
|
117
|
+
function readCookie(name) {
|
|
118
|
+
const m = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'))
|
|
119
|
+
return m ? decodeURIComponent(m[1]) : null
|
|
120
|
+
}
|
|
121
|
+
function persistentGuestId() {
|
|
122
|
+
let id = q.get('uid') // explicit pin wins
|
|
123
|
+
if (!id) { try { id = localStorage.getItem('oc_uid') } catch (e) {} }
|
|
124
|
+
if (!id) id = readCookie('oc_uid')
|
|
125
|
+
if (!id) id = 'g_' + Math.random().toString(36).slice(2) + Date.now().toString(36)
|
|
126
|
+
try { localStorage.setItem('oc_uid', id) } catch (e) {}
|
|
127
|
+
const secure = location.protocol === 'https:' ? '; Secure' : ''
|
|
128
|
+
document.cookie = 'oc_uid=' + encodeURIComponent(id) +
|
|
129
|
+
'; Max-Age=' + (60 * 60 * 24 * 365) + '; Path=/; SameSite=Lax' + secure
|
|
130
|
+
return id
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Prefer SERVER-OWNED identity: the relay mints a signed guest token and
|
|
134
|
+
// sets an httpOnly cookie scoped to the parent domain, so the same guest is
|
|
135
|
+
// recognised across refreshes regardless of client storage. Falls back to
|
|
136
|
+
// the client-persisted id if the relay can't be reached — and NEVER hangs:
|
|
137
|
+
// fetch() has no built-in timeout, so without this a slow/unreachable relay
|
|
138
|
+
// would leave the promise pending forever and the widget would never mount
|
|
139
|
+
// (a blank page). We race it against a short timeout.
|
|
140
|
+
let apiBase = wsUrl.replace('wss://', 'https://').replace('ws://', 'http://')
|
|
141
|
+
if (apiBase.endsWith('/ws')) apiBase = apiBase.slice(0, -3)
|
|
142
|
+
async function resolveToken() {
|
|
143
|
+
const pinned = q.get('token') || q.get('uid') // host-supplied identity wins
|
|
144
|
+
if (pinned) return pinned
|
|
145
|
+
try {
|
|
146
|
+
const ctrl = new AbortController()
|
|
147
|
+
const timer = setTimeout(() => ctrl.abort(), 3000)
|
|
148
|
+
const r = await fetch(apiBase + '/auth/guest', { method: 'POST', credentials: 'include', signal: ctrl.signal })
|
|
149
|
+
clearTimeout(timer)
|
|
150
|
+
if (r.ok) { const d = await r.json(); if (d && d.token) return d.token }
|
|
151
|
+
} catch (e) { /* unreachable/slow/aborted — fall back below */ }
|
|
152
|
+
return persistentGuestId()
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Mount only ever depends on a resolved token, and any failure surfaces as a
|
|
156
|
+
// visible message rather than a blank page.
|
|
157
|
+
resolveToken()
|
|
158
|
+
.catch(() => persistentGuestId())
|
|
159
|
+
.then((token) => {
|
|
160
|
+
try {
|
|
161
|
+
mount({
|
|
162
|
+
el: app,
|
|
163
|
+
token,
|
|
164
|
+
url: wsUrl,
|
|
165
|
+
profileId: profileId || 'p_hotel',
|
|
166
|
+
...(subjectId ? { subjectId } : {}),
|
|
167
|
+
accent: q.get('accent') || '#4F63F5',
|
|
168
|
+
})
|
|
169
|
+
} catch (err) {
|
|
170
|
+
app.innerHTML = '<div style="padding:24px;font:14px system-ui;color:#b91c1c">' +
|
|
171
|
+
'Chat failed to load. ' + (err && err.message ? String(err.message) : '') + '</div>'
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
</script>
|
|
175
|
+
</body>
|
|
176
|
+
</html>
|
package/dist/react.d.ts
CHANGED
|
@@ -9,6 +9,13 @@ interface BaseProps {
|
|
|
9
9
|
apiUrl?: string;
|
|
10
10
|
/** Your Relay profile ID — set as NEXT_PUBLIC_RELAY_PROFILE_ID in .env — required */
|
|
11
11
|
profileId: string;
|
|
12
|
+
/** A signed identity token — an ES256 JWT `{sub,iat,exp}` minted by YOUR
|
|
13
|
+
* backend for chatrooms with signed identity (guestPublicKey) enabled.
|
|
14
|
+
* This is the production identity tier; wins over `userId`. */
|
|
15
|
+
token?: string;
|
|
16
|
+
/** Called when a signed token expires: return a fresh token from your
|
|
17
|
+
* backend to renew the session without a reload. */
|
|
18
|
+
refreshToken?: () => Promise<string | null>;
|
|
12
19
|
/** Your logged-in user's stable ID. When omitted the widget automatically
|
|
13
20
|
* assigns a persistent anonymous ID from localStorage — no login required. */
|
|
14
21
|
userId?: string;
|
|
@@ -49,7 +56,7 @@ export interface ChatWidgetProps extends BaseProps {
|
|
|
49
56
|
* @example Basic support chat
|
|
50
57
|
* ```tsx
|
|
51
58
|
* <ChatWidget
|
|
52
|
-
* url={process.env.
|
|
59
|
+
* url={process.env.NEXT_PUBLIC_RELAY_URL}
|
|
53
60
|
* profileId={process.env.NEXT_PUBLIC_RELAY_PROFILE_ID}
|
|
54
61
|
* userId={session?.user.id}
|
|
55
62
|
* userName={session?.user.name}
|
|
@@ -57,19 +64,22 @@ export interface ChatWidgetProps extends BaseProps {
|
|
|
57
64
|
* />
|
|
58
65
|
* ```
|
|
59
66
|
*
|
|
60
|
-
* @example Multi-thread (tickets, bookings, orders)
|
|
67
|
+
* @example Multi-thread (tickets, bookings, orders) — one thread per subjectId
|
|
61
68
|
* ```tsx
|
|
62
69
|
* <ChatWidget
|
|
63
70
|
* url={...} profileId={...}
|
|
64
|
-
* showChatList
|
|
65
71
|
* subjectId={`ticket_${ticket.id}`}
|
|
66
72
|
* contextTitle={ticket.title}
|
|
67
73
|
* contextStatus={ticket.status}
|
|
68
74
|
* userId={session?.user.id}
|
|
69
75
|
* />
|
|
70
76
|
* ```
|
|
77
|
+
*
|
|
78
|
+
* Need a list of the user's threads with tap-to-open? That's `<ChatApp />`
|
|
79
|
+
* (inline) or `<ChatAppLauncher />` (floating bubble) — this component renders
|
|
80
|
+
* a single conversation.
|
|
71
81
|
*/
|
|
72
|
-
export declare function ChatWidget({ url, apiUrl, profileId, userId, userName, userEmail, userAvatar, contextTitle, contextSubtitle, contextStatus, subjectId, accent, launcher, position, quickReplies, height, i18n, translateLang, }: ChatWidgetProps): JSX.Element;
|
|
82
|
+
export declare function ChatWidget({ url, apiUrl, profileId, token, refreshToken, userId, userName, userEmail, userAvatar, contextTitle, contextSubtitle, contextStatus, subjectId, accent, launcher, position, quickReplies, height, i18n, translateLang, }: ChatWidgetProps): JSX.Element;
|
|
73
83
|
export interface MarketplaceChatProps extends BaseProps {
|
|
74
84
|
/** Unique ID for this listing — each listing gets its own thread.
|
|
75
85
|
* Omit for a general (non-item-specific) conversation. */
|
|
@@ -91,7 +101,7 @@ export interface MarketplaceChatProps extends BaseProps {
|
|
|
91
101
|
* ```tsx
|
|
92
102
|
* // On your listing detail page:
|
|
93
103
|
* <MarketplaceChat
|
|
94
|
-
* url={process.env.
|
|
104
|
+
* url={process.env.NEXT_PUBLIC_RELAY_URL}
|
|
95
105
|
* profileId={process.env.NEXT_PUBLIC_RELAY_PROFILE_ID}
|
|
96
106
|
* listingId={car.id}
|
|
97
107
|
* listingTitle={car.title}
|
|
@@ -104,35 +114,53 @@ export interface MarketplaceChatProps extends BaseProps {
|
|
|
104
114
|
* />
|
|
105
115
|
* ```
|
|
106
116
|
*
|
|
107
|
-
* **Without `listingId
|
|
108
|
-
* thread
|
|
109
|
-
*
|
|
117
|
+
* **Without `listingId`** — opens the buyer's single general (non-listing)
|
|
118
|
+
* thread with this chatroom. For a "My Messages" / inbox page with the
|
|
119
|
+
* WhatsApp-style thread list and tap-to-open, use `<ChatApp />` (or
|
|
120
|
+
* `<ChatAppLauncher />` for a floating bubble):
|
|
110
121
|
* ```tsx
|
|
111
122
|
* // On your /messages page:
|
|
112
|
-
* <
|
|
113
|
-
* url={process.env.
|
|
123
|
+
* <ChatApp
|
|
124
|
+
* url={process.env.NEXT_PUBLIC_RELAY_URL}
|
|
114
125
|
* profileId={process.env.NEXT_PUBLIC_RELAY_PROFILE_ID}
|
|
115
126
|
* userId={session?.user.id}
|
|
116
|
-
* userName={session?.user.name}
|
|
117
127
|
* />
|
|
118
128
|
* ```
|
|
119
129
|
*
|
|
120
130
|
* Only `url` and `profileId` are required. All other props are optional.
|
|
121
131
|
*/
|
|
122
|
-
export declare function MarketplaceChat({ url, apiUrl, profileId, listingId, listingTitle, listingMeta, listingPrice, listingStatus, userId, userName, userEmail, userAvatar, accent, launcher, position, quickReplies, height, i18n, translateLang, }: MarketplaceChatProps): JSX.Element;
|
|
132
|
+
export declare function MarketplaceChat({ url, apiUrl, profileId, token, refreshToken, listingId, listingTitle, listingMeta, listingPrice, listingStatus, userId, userName, userEmail, userAvatar, accent, launcher, position, quickReplies, height, i18n, translateLang, }: MarketplaceChatProps): JSX.Element;
|
|
123
133
|
export interface ChatAppProps {
|
|
124
|
-
/** Relay
|
|
134
|
+
/** Relay URL — ONE url, any scheme; `https://api.relay.paramms.com` is the
|
|
135
|
+
* recommended form. The WebSocket URL and REST base are derived from it —
|
|
136
|
+
* you do NOT need to pass `wss://` or `/ws`. */
|
|
125
137
|
url: string;
|
|
126
|
-
/** HTTP(S) base for REST calls
|
|
138
|
+
/** HTTP(S) base for REST calls — only when the REST API is on a different
|
|
139
|
+
* origin than the socket. Normally omit.
|
|
140
|
+
* @deprecated pass a single `url`; kept for back-compat. */
|
|
127
141
|
apiUrl?: string;
|
|
128
142
|
/** Your Relay profile ID — required */
|
|
129
143
|
profileId: string;
|
|
144
|
+
/** A signed identity token (ES256 JWT) for chatrooms with signed identity
|
|
145
|
+
* enabled — the production tier. Wins over `userId`. */
|
|
146
|
+
token?: string;
|
|
147
|
+
/** Return a fresh token when a signed token expires. */
|
|
148
|
+
refreshToken?: () => Promise<string | null>;
|
|
130
149
|
/** Your logged-in user's stable ID. Omit for anonymous (uses localStorage UID) */
|
|
131
150
|
userId?: string;
|
|
132
151
|
/** Optional: shown to agents in the dashboard */
|
|
133
152
|
userName?: string;
|
|
134
153
|
/** Optional: shown to agents in the dashboard */
|
|
135
154
|
userEmail?: string;
|
|
155
|
+
/** Which conversations the list shows (default 'tenant'):
|
|
156
|
+
* 'tenant' — every conversation this user has with the business that
|
|
157
|
+
* owns `profileId`, across ALL of its chatrooms — like a real
|
|
158
|
+
* messaging app. Each row opens against its own chatroom.
|
|
159
|
+
* 'profile' — only this chatroom's threads (the pre-1.0.30 behaviour).
|
|
160
|
+
* Tenancy note: guests never see or send tenant ids — the server resolves
|
|
161
|
+
* the tenant FROM the profileId, so `profileId` stays the only id you
|
|
162
|
+
* configure. */
|
|
163
|
+
scope?: 'profile' | 'tenant';
|
|
136
164
|
/** Brand colour hex — default '#4F63F5' */
|
|
137
165
|
accent?: string;
|
|
138
166
|
/** Container height. Default: '100%' */
|
|
@@ -142,21 +170,25 @@ export interface ChatAppProps {
|
|
|
142
170
|
}
|
|
143
171
|
/**
|
|
144
172
|
* Full chat-app component: conversation list on the left (or full screen on
|
|
145
|
-
* mobile), chat room on the right when a thread is selected
|
|
173
|
+
* mobile), chat room on the right when a thread is selected — like a
|
|
174
|
+
* standalone messaging app. Tapping a thread opens the chat inline; the ✎
|
|
175
|
+
* button starts a new conversation with the business.
|
|
146
176
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
177
|
+
* By default (`scope="tenant"`) the list shows EVERY conversation this user
|
|
178
|
+
* has with the business that owns `profileId` — across all of its chatrooms —
|
|
179
|
+
* and each row opens against its own chatroom. Pass `scope="profile"` to
|
|
180
|
+
* limit it to one chatroom's threads.
|
|
149
181
|
*
|
|
150
182
|
* @example
|
|
151
183
|
* ```tsx
|
|
152
184
|
* 'use client'
|
|
153
|
-
* import {
|
|
185
|
+
* import { ChatApp } from '@paramms/chat-widget/react'
|
|
154
186
|
*
|
|
155
187
|
* export default function MessagesPage({ session }) {
|
|
156
188
|
* return (
|
|
157
189
|
* <div style={{ height: '100vh' }}>
|
|
158
|
-
* <
|
|
159
|
-
* url={process.env.
|
|
190
|
+
* <ChatApp
|
|
191
|
+
* url={process.env.NEXT_PUBLIC_RELAY_URL}
|
|
160
192
|
* profileId={process.env.NEXT_PUBLIC_RELAY_PROFILE_ID}
|
|
161
193
|
* userId={session?.user.id}
|
|
162
194
|
* userName={session?.user.name}
|
|
@@ -167,18 +199,28 @@ export interface ChatAppProps {
|
|
|
167
199
|
* }
|
|
168
200
|
* ```
|
|
169
201
|
*/
|
|
170
|
-
export declare function ChatApp({ url, apiUrl, profileId, userId, userName, userEmail, accent, height, i18n, }: ChatAppProps): JSX.Element;
|
|
202
|
+
export declare function ChatApp({ url, apiUrl, profileId, token, refreshToken, userId, userName, userEmail, accent, height, i18n, scope, }: ChatAppProps): JSX.Element;
|
|
171
203
|
export interface ChatAppLauncherProps {
|
|
172
|
-
/** Relay
|
|
204
|
+
/** Relay URL — ONE url, any scheme; `https://api.relay.paramms.com` is the
|
|
205
|
+
* recommended form. The WebSocket URL and REST base are derived from it. */
|
|
173
206
|
url: string;
|
|
174
|
-
/** HTTP(S) base for REST calls
|
|
207
|
+
/** HTTP(S) base for REST calls — only when REST is on a different origin.
|
|
208
|
+
* @deprecated pass a single `url`; kept for back-compat. */
|
|
175
209
|
apiUrl?: string;
|
|
176
210
|
/** Your Relay profile ID — required */
|
|
177
211
|
profileId: string;
|
|
212
|
+
/** A signed identity token (ES256 JWT) for chatrooms with signed identity
|
|
213
|
+
* enabled — the production tier. Wins over `userId`. */
|
|
214
|
+
token?: string;
|
|
215
|
+
/** Return a fresh token when a signed token expires. */
|
|
216
|
+
refreshToken?: () => Promise<string | null>;
|
|
178
217
|
/** Your logged-in user's stable ID */
|
|
179
218
|
userId?: string;
|
|
180
219
|
userName?: string;
|
|
181
220
|
userEmail?: string;
|
|
221
|
+
/** Which conversations the panel's list shows — see ChatAppProps.scope.
|
|
222
|
+
* Default 'tenant': every conversation this user has with the business. */
|
|
223
|
+
scope?: 'profile' | 'tenant';
|
|
182
224
|
/** Brand colour hex — default '#4F63F5' */
|
|
183
225
|
accent?: string;
|
|
184
226
|
/** true → floating bubble fixed to the corner of the screen (like Intercom)
|
|
@@ -205,7 +247,7 @@ export interface ChatAppLauncherProps {
|
|
|
205
247
|
* @example Floating bubble (bottom-right)
|
|
206
248
|
* ```tsx
|
|
207
249
|
* <ChatAppLauncher
|
|
208
|
-
* url={process.env.
|
|
250
|
+
* url={process.env.NEXT_PUBLIC_RELAY_URL}
|
|
209
251
|
* profileId={process.env.NEXT_PUBLIC_RELAY_PROFILE_ID}
|
|
210
252
|
* userId={session?.user.id}
|
|
211
253
|
* floating
|
|
@@ -216,7 +258,7 @@ export interface ChatAppLauncherProps {
|
|
|
216
258
|
* @example Inline nav button
|
|
217
259
|
* ```tsx
|
|
218
260
|
* <ChatAppLauncher
|
|
219
|
-
* url={process.env.
|
|
261
|
+
* url={process.env.NEXT_PUBLIC_RELAY_URL}
|
|
220
262
|
* profileId={process.env.NEXT_PUBLIC_RELAY_PROFILE_ID}
|
|
221
263
|
* userId={session?.user.id}
|
|
222
264
|
* floating={false}
|
|
@@ -224,5 +266,5 @@ export interface ChatAppLauncherProps {
|
|
|
224
266
|
* />
|
|
225
267
|
* ```
|
|
226
268
|
*/
|
|
227
|
-
export declare function ChatAppLauncher({ url, apiUrl, profileId, userId, userName, userEmail, accent, floating, position, label, panelWidth, panelHeight, }: ChatAppLauncherProps): JSX.Element;
|
|
269
|
+
export declare function ChatAppLauncher({ url, apiUrl, profileId, token, refreshToken, userId, userName, userEmail, scope, accent, floating, position, label, panelWidth, panelHeight, }: ChatAppLauncherProps): JSX.Element;
|
|
228
270
|
export {};
|