import { AffectedUser, EventContext } from '@hawk.so/types'; import { HawkJavaScriptEvent } from './event'; import { Transport } from '@hawk.so/core'; import { BreadcrumbsOptions } from '../addons/breadcrumbs'; import { IssuesOptions } from './issues'; /** * JS Catcher initial settings */ export interface HawkInitialSettings { /** * User project's Integration Token */ token: string; /** * Enable debug mode * Send raw event's data additionally in addons field by key 'RAW_EVENT_DATA' */ debug?: boolean; /** * Current release and bundle version */ release?: string; /** * Current user information */ user?: AffectedUser; /** * Any additional data you want to send with every event */ context?: EventContext; /** * How many time we should try to reconnect when connection lost. * * @deprecated not used anymore */ reconnectionAttempts?: number; /** * How many time we should wait between reconnection attempts. */ reconnectionTimeout?: number; /** * Hawk Collector endpoint. * Can be overwritten for development purposes. * * @example ws://localhost:3000/ws */ collectorEndpoint?: string; /** * Instance of a vue application * to handle its errors */ vue?: any; /** * Do not initialize global errors handling * This options still allow you send events manually * * @deprecated Use `issues.errors` instead. */ disableGlobalErrorsHandling?: boolean; /** * This Method allows you to filter any data you don't want sending to Hawk. * - Return modified event — it will be sent instead of the original. * - Return `false` — the event will be dropped entirely. * - Any other value is invalid — the original event is sent as-is (a warning is logged). */ beforeSend?(event: HawkJavaScriptEvent): HawkJavaScriptEvent | false | void; /** * Disable Vue.js error handler * * Used by @hawk.so/nuxt since Nuxt has own error hook. */ disableVueErrorHandler?: boolean; /** * Console log handler */ consoleTracking?: boolean; /** * Breadcrumbs configuration * Pass false to disable breadcrumbs entirely * Pass options object to configure breadcrumbs behavior * * @default enabled with default options */ breadcrumbs?: false | BreadcrumbsOptions; /** * Custom transport for sending events. * If not provided, default WebSocket transport is used. */ transport?: Transport; /** * Issues configuration: * `errors`, `webVitals`, `longTasks`, `longAnimationFrames`. * * Pass `false` to disable all automatic issue tracking. * Manual sending via `.send()` still works. */ issues?: false | IssuesOptions; }