@sidebandai/sideband-react 1.4.4 → 1.4.5-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,6 +8,9 @@ Sideband adds in-app Pulse prompts and event tracking to React apps.
|
|
|
8
8
|
- A Sideband API key
|
|
9
9
|
- Your application's version
|
|
10
10
|
|
|
11
|
+
For React 18 apps, use [`@sidebandai/sideband-web`](https://www.npmjs.com/package/@sidebandai/sideband-web),
|
|
12
|
+
which has no framework dependency.
|
|
13
|
+
|
|
11
14
|
## Install
|
|
12
15
|
|
|
13
16
|
```bash
|
|
@@ -127,9 +130,32 @@ not set, and restoring the stored ID on a page load send nothing.
|
|
|
127
130
|
The SDK sends events in batches, by default about once a second. Set
|
|
128
131
|
`flushIntervalSeconds` (seconds, at least 1) to change it. A pulse can show only
|
|
129
132
|
after the batch that holds its trigger event is sent, so a longer interval delays
|
|
130
|
-
pulses.
|
|
133
|
+
pulses. After each send, the server sets a minimum wait before the next
|
|
134
|
+
regular send, and the SDK honors it. A pulse therefore usually shows a few
|
|
135
|
+
seconds after its trigger event, not exactly one second after it.
|
|
131
136
|
|
|
132
137
|
`SidebandProviderConfig` in the package's type definitions lists the optional
|
|
133
138
|
settings, such as `shouldPresentPulse` to hold a Pulse back for a better
|
|
134
139
|
moment and `onError` for background errors. `useSideband()` also returns
|
|
135
140
|
`flush`, which sends queued events now.
|
|
141
|
+
|
|
142
|
+
## Automated test builds
|
|
143
|
+
|
|
144
|
+
Builds that use your Development channel's key also receive the pulses you
|
|
145
|
+
publish there. In unattended UI tests, a pulse can cover the page and break the
|
|
146
|
+
next step. To keep sending events but hold pulses back in those builds, return
|
|
147
|
+
`'notNow'` from `shouldPresentPulse`:
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
<SidebandProvider
|
|
151
|
+
config={{
|
|
152
|
+
apiKey: 'YOUR_API_KEY',
|
|
153
|
+
appVersion: '1.0.0',
|
|
154
|
+
shouldPresentPulse: () => (isAutomatedTest ? 'notNow' : 'showNow'),
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`isAutomatedTest` stands for however your test runs mark themselves, such as a
|
|
160
|
+
build-time variable. The SDK reports each pulse held back this way as a "not
|
|
161
|
+
now" dismissal.
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sidebandai/sideband-react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5-rc.1",
|
|
4
4
|
"description": "React SDK for Sideband client sync surveys and prompts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-dom": "^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sidebandai/sideband-core": "1.4.
|
|
42
|
+
"@sidebandai/sideband-core": "1.4.5-rc.1"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "vite build --config ../../vite.react.config.ts && tsc -p tsconfig.lib.json && node ../../scripts/prepare-react-package.mjs",
|