@stacksee/analytics 0.7.0 → 0.9.0
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/dist/providers/bento/client.d.ts +101 -0
- package/dist/providers/client.d.ts +3 -0
- package/dist/providers/client.js +415 -141
- package/dist/providers/proxy/client.d.ts +56 -0
- package/dist/providers/proxy/server.d.ts +55 -0
- package/dist/providers/proxy/types.d.ts +64 -0
- package/dist/providers/server.d.ts +2 -0
- package/dist/providers/server.js +209 -123
- package/package.json +5 -1
|
@@ -8,6 +8,11 @@ interface BentoClient {
|
|
|
8
8
|
updateFields(fields: Record<string, unknown>): void;
|
|
9
9
|
getEmail(): string | null;
|
|
10
10
|
getName(): string | null;
|
|
11
|
+
showSurveyForm(element: HTMLElement, surveyId: string, type?: "popup" | "inline"): void;
|
|
12
|
+
spamCheck(email: string): Promise<boolean>;
|
|
13
|
+
showChat?(): void;
|
|
14
|
+
hideChat?(): void;
|
|
15
|
+
openChat?(): void;
|
|
11
16
|
}
|
|
12
17
|
export interface BentoClientConfig {
|
|
13
18
|
/**
|
|
@@ -43,5 +48,101 @@ export declare class BentoClientProvider extends BaseAnalyticsProvider {
|
|
|
43
48
|
pageView(properties?: Record<string, unknown>, context?: EventContext): void;
|
|
44
49
|
pageLeave(properties?: Record<string, unknown>, context?: EventContext): void;
|
|
45
50
|
reset(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Add a tag to the current user
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* bentoProvider.tag('premium_user');
|
|
57
|
+
* bentoProvider.tag('beta_tester');
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
tag(tag: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Get the current user's email address
|
|
63
|
+
*
|
|
64
|
+
* @returns The user's email or null if not identified
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const email = bentoProvider.getEmail();
|
|
69
|
+
* if (email) {
|
|
70
|
+
* console.log('Current user:', email);
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
getEmail(): string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Get the current user's name
|
|
77
|
+
*
|
|
78
|
+
* @returns The user's name or null if not set
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const name = bentoProvider.getName();
|
|
83
|
+
* if (name) {
|
|
84
|
+
* console.log('Welcome back,', name);
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
getName(): string | null;
|
|
89
|
+
/**
|
|
90
|
+
* Show a Bento survey form
|
|
91
|
+
*
|
|
92
|
+
* @param element - The HTML element to render the survey in
|
|
93
|
+
* @param surveyId - The survey ID from your Bento account
|
|
94
|
+
* @param type - Display type: 'popup' or 'inline' (default: 'popup')
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const container = document.getElementById('survey-container');
|
|
99
|
+
* if (container) {
|
|
100
|
+
* bentoProvider.showSurveyForm(container, 'survey-123', 'popup');
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
showSurveyForm(element: HTMLElement, surveyId: string, type?: "popup" | "inline"): void;
|
|
105
|
+
/**
|
|
106
|
+
* Validate an email address using Bento's spam check
|
|
107
|
+
*
|
|
108
|
+
* @param email - The email address to validate
|
|
109
|
+
* @returns Promise that resolves to true if email is valid, false if spam
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const isValid = await bentoProvider.spamCheck('user@example.com');
|
|
114
|
+
* if (!isValid) {
|
|
115
|
+
* console.log('Invalid or spam email detected');
|
|
116
|
+
* }
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
spamCheck(email: string): Promise<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* Show the Bento chat widget
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* bentoProvider.showChat();
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
showChat(): void;
|
|
129
|
+
/**
|
|
130
|
+
* Hide the Bento chat widget
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* bentoProvider.hideChat();
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
hideChat(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Open the Bento chat widget
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* bentoProvider.openChat();
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
openChat(): void;
|
|
46
147
|
}
|
|
47
148
|
export {};
|
|
@@ -5,3 +5,6 @@ export { BentoClientProvider } from './bento/client.js';
|
|
|
5
5
|
export type { BentoClientConfig } from './bento/client.js';
|
|
6
6
|
export { PirschClientProvider } from './pirsch/client.js';
|
|
7
7
|
export type { PirschClientConfig } from './pirsch/client.js';
|
|
8
|
+
export { ProxyProvider } from './proxy/client.js';
|
|
9
|
+
export type { ProxyProviderConfig } from './proxy/client.js';
|
|
10
|
+
export type { ProxyBatchConfig, ProxyRetryConfig, ProxyEvent, ProxyPayload, ProxyTrackEvent, ProxyIdentifyEvent, ProxyPageViewEvent, ProxyResetEvent, } from './proxy/types.js';
|