Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/bun/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ export interface BaseBunOptions {
/** Sets an optional server name (device name) */
serverName?: string;

/**
* If you use Spotlight by Sentry during development, use
* this option to forward captured Sentry events to Spotlight.
*
* Either set it to true, or provide a specific Spotlight Sidecar URL.
*
* More details: https://spotlightjs.com/
*
* IMPORTANT: Only set this option to `true` while developing, not in production!
*/
spotlight?: boolean | string;

/**
* If this is set to true, the SDK will not set up OpenTelemetry automatically.
* In this case, you _have_ to ensure to set it up correctly yourself, including:
Expand Down
14 changes: 14 additions & 0 deletions packages/bun/test/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ describe('init()', () => {
expect(mockAutoPerformanceIntegrations).toHaveBeenCalledTimes(0);
});

it('enables spotlight with default URL from config `true`', () => {
const client = init({ dsn: PUBLIC_DSN, spotlight: true });

expect(client?.getOptions().spotlight).toBe(true);
expect(client?.getOptions().integrations.some(integration => integration.name === 'Spotlight')).toBe(true);
});

it('disables spotlight from config `false`', () => {
const client = init({ dsn: PUBLIC_DSN, spotlight: false });

expect(client?.getOptions().spotlight).toBe(false);
expect(client?.getOptions().integrations.some(integration => integration.name === 'Spotlight')).toBe(false);
});

it('installs merged default integrations, with overrides provided through options', () => {
const mockDefaultIntegrations = [
new MockIntegration('Some mock integration 2.1'),
Expand Down