Types reference
Every type the SDK exports. Both packages ship the same definitions.
CluebaseUser
The signed-in end user, supplied by you. Only id is required, and it is your own identifier for that person, never shown to them. It is also the key a data-deletion request is answered against.
interface CluebaseUser { id: string email?: string name?: string metadata?: Record<string, string | number | boolean>}CluebaseConfig
The provider's options. See Configuration for what each one does.
interface CluebaseConfig { apiKey: string apiEndpoint?: string environment?: 'development' | 'production' sessionId?: string identity?: boolean // default true onError?: (report: CluebaseErrorReport) => void sanitize?: (text: string) => string}CluebaseErrorReport
What is sent for a captured error, and what onError receives.
interface CluebaseErrorReport { errorName?: string errorMessage: string errorStack?: string componentStack?: string errorType?: CluebaseErrorType visitorId?: string user?: CluebaseUser context: CluebaseErrorContext}Identity rides as a distinct user object rather than being merged into context, so it can be validated, stored, and deleted as one thing.
CluebaseErrorContext
interface CluebaseErrorContext { url: string userAgent: string sessionId?: string timestamp: string additionalContext?: string httpStatus?: number integration?: string}CluebaseErrorType
How the error was captured. Set automatically for everything except a manual report.
type CluebaseErrorType = | 'api_error' // a request returned a non-2xx status | 'network_timeout' // aborted, timed out, or the connection dropped | 'payment_integration' // failure against a known payment host | 'render_crash' // caught by the page-level boundary | 'component_crash' // caught by a local CluebaseBoundary | 'unhandled_rejection' | 'global_error' | 'generic' // a manual report with no other signalIngest responses
What the server answers with. Use isRenderableIngest() rather than checking the variants by hand: a rate-limited or suppressed report has no conversation to show, and both mean the same thing to a caller.
type CluebaseIngestResponse = | CluebaseIngestResult // { incidentId, incidentToken, opening, history? } | CluebaseIngestRateLimited // { rateLimited: true, retryAfter? } | CluebaseIngestSuppressed // { widgetSuppressed: true }Others
CluebaseConversationMessage: one turn of a transcriptWidgetTheme: the per-project look configured in your dashboardCluebaseBoundaryProps,CluebaseReportExtras,InjectOverlayOptions
Next steps
- Client SDK reference: every export
- Identifying users: using
CluebaseUser
