@tmls-ai/support
v0.1.7
Published
Embeddable Timeless support widget — bottom-right report overlay (type / severity / screenshot) + ticket thread. Auto-captures context, talks to tmls-support-api.
Readme
@tmls/support
Embeddable Timeless support widget — bottom-right report overlay (type /
severity / screenshot) + ticket thread. Auto-captures context and talks to
tmls-support-api.
Usage (React)
import { SupportWidget } from '@tmls/support';
<SupportWidget
productId="drona"
apiUrl="https://support.timeless.app"
getToken={() => fetch('/api/support-token').then(r => r.text())}
user={{ id, email, name, plan }}
accent="#0a84ff"
appVersion={import.meta.env.VITE_BUILD}
getContext={() => ({ route: location.pathname, config, specs, conversationId })}
/>Usage (any app, Shadow-DOM isolated)
import { mountSupportWidget } from '@tmls/support';
const unmount = mountSupportWidget({ productId, apiUrl, getToken, getContext });Host backend contract
Expose an endpoint that signs a short-lived JWT with the product's
JWT_SECRET_<PRODUCT> (same secret the Worker holds):
jwt.sign({ productId: 'drona', userId, email, plan }, JWT_SECRET_DRONA, { expiresIn: '10m' })The widget never holds a secret; the server trusts the signed token.
Build
npm run build # → dist/ (ESM + types)v1:
src/types.tsmirrorstmls-support-api/src/types.ts— keep in sync.
