From 2d04a7b732cae3d6c7caebbf482f24a419ad7aa8 Mon Sep 17 00:00:00 2001 From: Alan Charles <50601149+alanjcharles@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:32:42 -0400 Subject: [PATCH 1/2] add section for custom signals --- src/connections/auto-instrumentation/web-setup.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/connections/auto-instrumentation/web-setup.md b/src/connections/auto-instrumentation/web-setup.md index 12019cabdd..8f17f70f90 100644 --- a/src/connections/auto-instrumentation/web-setup.md +++ b/src/connections/auto-instrumentation/web-setup.md @@ -92,6 +92,18 @@ https://my-website.com?segment_signals_debug=false ### Advanced +#### Emitting Custom Signals +If you need to listen for data that is unavailable to the Signals plugin by default, you can create and emit a custom signal: + +```ts +import { signalsPlugin } from './analytics' // assuming you exported your plugin instance. + +signalsPlugin.addSignal({ + type: 'userDefined', + data: { foo: 'bar' } +}) +``` + #### Listening to signals ```ts const signalsPlugin = new SignalsPlugin() From 007007e2e14561f6acaff5338e583721e4b361c0 Mon Sep 17 00:00:00 2001 From: Alan Charles <50601149+alanjcharles@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:56:29 -0400 Subject: [PATCH 2/2] Update src/connections/auto-instrumentation/web-setup.md Co-authored-by: stayseesong <83784848+stayseesong@users.noreply.github.com> --- src/connections/auto-instrumentation/web-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/auto-instrumentation/web-setup.md b/src/connections/auto-instrumentation/web-setup.md index 8f17f70f90..4c938a597d 100644 --- a/src/connections/auto-instrumentation/web-setup.md +++ b/src/connections/auto-instrumentation/web-setup.md @@ -92,7 +92,7 @@ https://my-website.com?segment_signals_debug=false ### Advanced -#### Emitting Custom Signals +#### Emitting custom signals If you need to listen for data that is unavailable to the Signals plugin by default, you can create and emit a custom signal: ```ts