Skip to content

Commit dc2acc9

Browse files
authored
Merge pull request #7130 from segmentio/acharles/update-signals-web
add section for custom signals
2 parents 6f4ea63 + 007007e commit dc2acc9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/connections/auto-instrumentation/web-setup.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ https://my-website.com?segment_signals_debug=false
9292

9393
### Advanced
9494

95+
#### Emitting custom signals
96+
If you need to listen for data that is unavailable to the Signals plugin by default, you can create and emit a custom signal:
97+
98+
```ts
99+
import { signalsPlugin } from './analytics' // assuming you exported your plugin instance.
100+
101+
signalsPlugin.addSignal({
102+
type: 'userDefined',
103+
data: { foo: 'bar' }
104+
})
105+
```
106+
95107
#### Listening to signals
96108
```ts
97109
const signalsPlugin = new SignalsPlugin()

0 commit comments

Comments
 (0)