File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,18 @@ export interface BaseBunOptions {
2222 /** Sets an optional server name (device name) */
2323 serverName ?: string ;
2424
25+ /**
26+ * If you use Spotlight by Sentry during development, use
27+ * this option to forward captured Sentry events to Spotlight.
28+ *
29+ * Either set it to true, or provide a specific Spotlight Sidecar URL.
30+ *
31+ * More details: https://spotlightjs.com/
32+ *
33+ * IMPORTANT: Only set this option to `true` while developing, not in production!
34+ */
35+ spotlight ?: boolean | string ;
36+
2537 /**
2638 * If this is set to true, the SDK will not set up OpenTelemetry automatically.
2739 * In this case, you _have_ to ensure to set it up correctly yourself, including:
Original file line number Diff line number Diff line change @@ -38,6 +38,20 @@ describe('init()', () => {
3838 expect ( mockAutoPerformanceIntegrations ) . toHaveBeenCalledTimes ( 0 ) ;
3939 } ) ;
4040
41+ it ( 'enables spotlight with default URL from config `true`' , ( ) => {
42+ const client = init ( { dsn : PUBLIC_DSN , spotlight : true } ) ;
43+
44+ expect ( client ?. getOptions ( ) . spotlight ) . toBe ( true ) ;
45+ expect ( client ?. getOptions ( ) . integrations . some ( integration => integration . name === 'Spotlight' ) ) . toBe ( true ) ;
46+ } ) ;
47+
48+ it ( 'disables spotlight from config `false`' , ( ) => {
49+ const client = init ( { dsn : PUBLIC_DSN , spotlight : false } ) ;
50+
51+ expect ( client ?. getOptions ( ) . spotlight ) . toBe ( false ) ;
52+ expect ( client ?. getOptions ( ) . integrations . some ( integration => integration . name === 'Spotlight' ) ) . toBe ( false ) ;
53+ } ) ;
54+
4155 it ( 'installs merged default integrations, with overrides provided through options' , ( ) => {
4256 const mockDefaultIntegrations = [
4357 new MockIntegration ( 'Some mock integration 2.1' ) ,
You can’t perform that action at this time.
0 commit comments