Skip to content

Commit

Permalink
Merge pull request #7130 from segmentio/acharles/update-signals-web
Browse files Browse the repository at this point in the history
add section for custom signals
  • Loading branch information
stayseesong authored Oct 10, 2024
2 parents 6f4ea63 + 007007e commit dc2acc9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/connections/auto-instrumentation/web-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dc2acc9

Please sign in to comment.