@usero/sdk 1.1.6 → 1.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usero/sdk",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "Usero SDK. Drop-in feedback widget (vanilla JS, React, or script tag) plus future plugins like session replay. Zero config, framework-free, tiny.",
5
5
  "license": "MIT",
6
6
  "author": "Will Smith <will@willsmithte.com>",
@@ -1,69 +0,0 @@
1
- type FeedbackRating = 1 | 2 | 3 | 4;
2
- interface ScreenshotData {
3
- fileName: string;
4
- url: string;
5
- fileSize: number;
6
- width?: number;
7
- height?: number;
8
- mimeType: string;
9
- }
10
- interface FeedbackSubmission {
11
- clientId: string;
12
- rating?: FeedbackRating;
13
- comment?: string;
14
- userEmail?: string;
15
- pageUrl: string;
16
- pageTitle: string;
17
- referrer?: string;
18
- environment?: string;
19
- screenshots?: ScreenshotData[];
20
- metadata?: Record<string, unknown>;
21
- replayEvents?: string;
22
- sessionReplayId?: string;
23
- replayOffsetMs?: number;
24
- }
25
-
26
- interface PluginLogger {
27
- debug: (...args: unknown[]) => void;
28
- info: (...args: unknown[]) => void;
29
- warn: (...args: unknown[]) => void;
30
- error: (...args: unknown[]) => void;
31
- }
32
- interface PluginContext {
33
- clientId: string;
34
- baseUrl: string;
35
- getStore: <T>() => T | undefined;
36
- setStore: <T>(value: T) => void;
37
- logger: PluginLogger;
38
- resolveUser?: () => void;
39
- getSdkSessionId?: () => string;
40
- getAnonymousId?: () => string;
41
- getUserId?: () => string | null;
42
- getReplayStartMs?: () => number | null;
43
- publishReplayStartMs?: (epochMs: number) => void;
44
- }
45
- interface UseroPlugin {
46
- name: string;
47
- onInit?: (ctx: PluginContext) => void | Promise<void>;
48
- onFeedbackSubmit?: (ctx: PluginContext, submission: FeedbackSubmission) => Promise<Partial<FeedbackSubmission> | undefined> | Partial<FeedbackSubmission> | undefined;
49
- onDestroy?: (ctx: PluginContext) => void;
50
- }
51
-
52
- interface UserTestOptions {
53
- queryParam?: string;
54
- chunkSeconds?: number;
55
- apiUrl?: string;
56
- testerName?: string;
57
- hideIndicator?: boolean;
58
- }
59
- declare function getTestSlug(queryParam: string): string | null;
60
- declare function isMediaRecorderSupported(): boolean;
61
- declare function pickMimeType(): string | undefined;
62
- declare function userTest(options?: UserTestOptions): UseroPlugin;
63
- declare const __test__: {
64
- getTestSlug: typeof getTestSlug;
65
- pickMimeType: typeof pickMimeType;
66
- isMediaRecorderSupported: typeof isMediaRecorderSupported;
67
- };
68
-
69
- export { type UserTestOptions, __test__, userTest };
@@ -1,69 +0,0 @@
1
- type FeedbackRating = 1 | 2 | 3 | 4;
2
- interface ScreenshotData {
3
- fileName: string;
4
- url: string;
5
- fileSize: number;
6
- width?: number;
7
- height?: number;
8
- mimeType: string;
9
- }
10
- interface FeedbackSubmission {
11
- clientId: string;
12
- rating?: FeedbackRating;
13
- comment?: string;
14
- userEmail?: string;
15
- pageUrl: string;
16
- pageTitle: string;
17
- referrer?: string;
18
- environment?: string;
19
- screenshots?: ScreenshotData[];
20
- metadata?: Record<string, unknown>;
21
- replayEvents?: string;
22
- sessionReplayId?: string;
23
- replayOffsetMs?: number;
24
- }
25
-
26
- interface PluginLogger {
27
- debug: (...args: unknown[]) => void;
28
- info: (...args: unknown[]) => void;
29
- warn: (...args: unknown[]) => void;
30
- error: (...args: unknown[]) => void;
31
- }
32
- interface PluginContext {
33
- clientId: string;
34
- baseUrl: string;
35
- getStore: <T>() => T | undefined;
36
- setStore: <T>(value: T) => void;
37
- logger: PluginLogger;
38
- resolveUser?: () => void;
39
- getSdkSessionId?: () => string;
40
- getAnonymousId?: () => string;
41
- getUserId?: () => string | null;
42
- getReplayStartMs?: () => number | null;
43
- publishReplayStartMs?: (epochMs: number) => void;
44
- }
45
- interface UseroPlugin {
46
- name: string;
47
- onInit?: (ctx: PluginContext) => void | Promise<void>;
48
- onFeedbackSubmit?: (ctx: PluginContext, submission: FeedbackSubmission) => Promise<Partial<FeedbackSubmission> | undefined> | Partial<FeedbackSubmission> | undefined;
49
- onDestroy?: (ctx: PluginContext) => void;
50
- }
51
-
52
- interface UserTestOptions {
53
- queryParam?: string;
54
- chunkSeconds?: number;
55
- apiUrl?: string;
56
- testerName?: string;
57
- hideIndicator?: boolean;
58
- }
59
- declare function getTestSlug(queryParam: string): string | null;
60
- declare function isMediaRecorderSupported(): boolean;
61
- declare function pickMimeType(): string | undefined;
62
- declare function userTest(options?: UserTestOptions): UseroPlugin;
63
- declare const __test__: {
64
- getTestSlug: typeof getTestSlug;
65
- pickMimeType: typeof pickMimeType;
66
- isMediaRecorderSupported: typeof isMediaRecorderSupported;
67
- };
68
-
69
- export { type UserTestOptions, __test__, userTest };