Interface SDKOptions

interface SDKOptions {
    apiURL?: string;
    appKey: string;
    baseURL?: string;
    build?: string;
    deviceName?: string;
    enableLogcatLogging?: boolean;
    ignoreException?: ExceptionFilter;
    logBrowserEvents?: boolean;
    logUIEvents?: boolean;
    maximumLocalStorageSize?: number;
    overrideConsoleMethods?: boolean;
    printToConsole?: boolean;
    registerErrorHandler?: boolean;
    version?: string;
}

Properties

apiURL?: string

Base URL to Bugfender API

appKey: string

The app key to log into

baseURL?: string

Base URL to Bugfender web dashboard

build?: string

App build identifier

deviceName?: string

Device name, this will be shown on the dashboard devices list. Defaults to browser + OS.

enableLogcatLogging?: boolean

Logs all logs written via Logcat. Defaults to false. Android only.

ignoreException?: ExceptionFilter

Configure exception filtering to ignore certain exceptions from being reported as crashes. Can be:

  • A function: (info) => info.message.includes('Script error')
  • An array of patterns: ['Script error', /^ResizeObserver/i]
  • An object with both: { filter: (info) => ..., patterns: [...] }

Example

// Ignore specific error messages
ignoreException: ['Script error', 'NetworkError']

Example

// Ignore using regex patterns
ignoreException: [/^ResizeObserver/i, /^Non-Error/i]

Example

// Ignore using a custom function
ignoreException: (info) => {
return info.message.includes('Third-party script') ||
info.filename?.includes('analytics.js');
}

Example

// Combine patterns and function
ignoreException: {
patterns: ['Script error'],
filter: (info) => info.handler === 'UnhandledRejection' && info.message.includes('canceled')
}
logBrowserEvents?: boolean

Register a handler for most common browser events to report them to Bugfender. Defaults to true.

logUIEvents?: boolean

Register a handler for most common UI events to report them to Bugfender. Defaults to true.

maximumLocalStorageSize?: number

Set the maximum size to store local log files in bytes. Range accepted is from 1MB to 50MB. Defaults to 5MB. iOS & Android only.

overrideConsoleMethods?: boolean

Override default window.console so it also logs to Bugfender. Defaults to true.

printToConsole?: boolean

Print also with window.console when Bugfender logging methods are called. Defaults to true.

registerErrorHandler?: boolean

Register error handler for uncaught errors that reports a crash to Bugfender. Defaults to true.

version?: string

App version identifier