@sidebandai/sideband-web 0.0.0-stage → 1.4.3
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/LICENSE +21 -0
- package/README.md +40 -2
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1085 -0
- package/dist/sideband.iife.js +1 -0
- package/dist/ui/icons.d.ts +6 -0
- package/dist/ui/icons.d.ts.map +1 -0
- package/dist/ui/snackbar-ui.d.ts +35 -0
- package/dist/ui/snackbar-ui.d.ts.map +1 -0
- package/dist/ui/survey-ui.d.ts +60 -0
- package/dist/ui/survey-ui.d.ts.map +1 -0
- package/package.json +33 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SidebandAI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sideband Web SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sideband adds in-app Pulse prompts and event tracking to websites, with no
|
|
4
|
+
framework dependency.
|
|
5
|
+
|
|
6
|
+
## Requirements
|
|
7
|
+
|
|
8
|
+
- A Sideband API key
|
|
9
|
+
- Your application's version
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @sidebandai/sideband-web
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configure
|
|
18
|
+
|
|
19
|
+
Configure Sideband once when your app starts in the browser:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { Sideband } from '@sidebandai/sideband-web'
|
|
23
|
+
|
|
24
|
+
Sideband.configure({
|
|
25
|
+
apiKey: 'YOUR_API_KEY',
|
|
26
|
+
appVersion: '1.0.0',
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Replace `1.0.0` with your application's version, not the SDK version.
|
|
31
|
+
`appVersion` must be a non-empty string of at most 64 characters.
|
|
32
|
+
|
|
33
|
+
Sideband presents available Pulses automatically. Styles are included; no
|
|
34
|
+
stylesheet import is required.
|
|
35
|
+
|
|
36
|
+
## Install Without a Bundler
|
|
37
|
+
|
|
38
|
+
Copy `node_modules/@sidebandai/sideband-web/dist/sideband.iife.js` to your
|
|
39
|
+
website's public assets and load it before your application script. The bundle
|
|
40
|
+
exposes `window.Sideband`; call `window.Sideband.configure` with the same
|
|
41
|
+
configuration shown above.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { EventMetadata, SidebandCoreConfig, SidebandRuntime, SimulatedPulseDefinition, TrackOptions } from '@sidebandai/sideband-core';
|
|
2
|
+
export { createSidebandClient, getDeviceId, getSessionId, SidebandApiError, SurveySessionStore, buildFabTitle, getChoiceValue, SyncEngine, } from '@sidebandai/sideband-core';
|
|
3
|
+
export type { AnsweredInteraction, ApiErrorDetail, ClientContext, CompletionActionStyle, CompletionActionType, CompletionIconType, CompletionType, DismissedInteraction, EventMetadata, EventRecord, Fab, FabOffset, FabPlacement, FabPoint, FabState, Interaction, Platform, PendingPulse, SyncEndpoint, Pulse, PulseAnswer, PulseCompletion, PulseCompletionAction, PulseQuestion, QuestionType, SentimentPresentation, SentimentPresentationOptions, BarPosition, BarBehavior, SimulatedPulseDefinition, SidebandClient, SidebandClientConfig, SidebandCoreConfig, SurveyAnswerDraft, SurveyAnswerMap, SurveyAnswerValue, SurveySessionState, SurveyStoreSnapshot, SurveyStoreUpdateReason, SyncEngineDeps, SyncEngineOptions, SyncErrorResponse, ServiceUnavailableError, SyncOptions, SyncRequest, SyncResponse, TrackedEvent, TrackOptions, Theme, ThemeColor, TimerStyle, SurveyPresentationDecision, SurveyPresentationKind, } from '@sidebandai/sideband-core';
|
|
4
|
+
export type SidebandWebConfig = SidebandCoreConfig & {
|
|
5
|
+
ui?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type SidebandInstance = {
|
|
8
|
+
track: (eventName: string, metadata?: EventMetadata, options?: TrackOptions) => void;
|
|
9
|
+
tagUser: (userId: string) => void;
|
|
10
|
+
untagUser: () => void;
|
|
11
|
+
sync: SidebandRuntime['sync'];
|
|
12
|
+
flush: () => Promise<void>;
|
|
13
|
+
openSurvey: () => void;
|
|
14
|
+
presentSimulatedPulse: (definition: SimulatedPulseDefinition) => boolean;
|
|
15
|
+
closeSurvey: () => Promise<void>;
|
|
16
|
+
getDeviceId: () => string;
|
|
17
|
+
destroy: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function configure(config: SidebandWebConfig): SidebandInstance;
|
|
20
|
+
export declare function track(eventName: string, metadata?: EventMetadata, options?: TrackOptions): void;
|
|
21
|
+
export declare function tagUser(userId: string): void;
|
|
22
|
+
export declare function untagUser(): void;
|
|
23
|
+
export declare function flush(): Promise<void>;
|
|
24
|
+
export declare function presentSimulatedPulse(definition: SimulatedPulseDefinition): boolean;
|
|
25
|
+
export declare function destroy(): void;
|
|
26
|
+
export declare const Sideband: {
|
|
27
|
+
configure: typeof configure;
|
|
28
|
+
track: typeof track;
|
|
29
|
+
tagUser: typeof tagUser;
|
|
30
|
+
untagUser: typeof untagUser;
|
|
31
|
+
flush: typeof flush;
|
|
32
|
+
presentSimulatedPulse: typeof presentSimulatedPulse;
|
|
33
|
+
destroy: typeof destroy;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,YAAY,EACb,MAAM,2BAA2B,CAAA;AAIlC,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,UAAU,GACX,MAAM,2BAA2B,CAAA;AAClC,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,GAAG,EACH,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,4BAA4B,EAC5B,WAAW,EACX,WAAW,EACX,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,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