@keverdjs/fraud-sdk-vue 1.1.0 → 2.0.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/index.d.mts CHANGED
@@ -93,7 +93,6 @@ interface KeverdVisitorData {
93
93
  }
94
94
  interface KeverdConfig {
95
95
  apiKey: string;
96
- endpoint?: string;
97
96
  userId?: string;
98
97
  debug?: boolean;
99
98
  extendedResult?: boolean;
@@ -101,7 +100,6 @@ interface KeverdConfig {
101
100
  }
102
101
  interface KeverdLoadOptions {
103
102
  apiKey: string;
104
- endpoint?: string;
105
103
  debug?: boolean;
106
104
  }
107
105
  interface KeverdVisitorDataOptions {
@@ -145,18 +143,43 @@ declare class KeverdSDK {
145
143
  * Transform API response to visitor data format
146
144
  */
147
145
  private transformResponse;
148
- /**
149
- * Get default endpoint
150
- */
151
- private getDefaultEndpoint;
152
146
  /**
153
147
  * Generate a session ID
154
148
  */
155
149
  private generateSessionId;
150
+ /**
151
+ * Start a new session (called automatically on init, but can be called manually)
152
+ */
153
+ startSession(userId?: string, deviceHash?: string, metadata?: Record<string, unknown>): Promise<void>;
154
+ /**
155
+ * End the current session
156
+ */
157
+ endSession(): Promise<void>;
158
+ /**
159
+ * Pause the current session (e.g., when app goes to background)
160
+ */
161
+ pauseSession(): Promise<void>;
162
+ /**
163
+ * Resume a paused session (e.g., when app comes to foreground)
164
+ */
165
+ resumeSession(): Promise<void>;
166
+ /**
167
+ * Get current session status
168
+ */
169
+ getSessionStatus(): Promise<{
170
+ session_id: string;
171
+ status: string;
172
+ is_active: boolean;
173
+ is_paused: boolean;
174
+ event_count: number;
175
+ started_at: string;
176
+ last_activity_at: string;
177
+ duration_seconds: number | null;
178
+ } | null>;
156
179
  /**
157
180
  * Destroy the SDK instance
158
181
  */
159
- destroy(): void;
182
+ destroy(): Promise<void>;
160
183
  /**
161
184
  * Get current configuration
162
185
  */
@@ -214,13 +237,41 @@ declare function useKeverdProvider(options: KeverdLoadOptions): {
214
237
  sdk: Ref<{
215
238
  init: (config: KeverdConfig) => void;
216
239
  getVisitorData: (_options?: KeverdVisitorDataOptions) => Promise<KeverdVisitorData>;
217
- destroy: () => void;
240
+ startSession: (userId?: string, deviceHash?: string, metadata?: Record<string, unknown>) => Promise<void>;
241
+ endSession: () => Promise<void>;
242
+ pauseSession: () => Promise<void>;
243
+ resumeSession: () => Promise<void>;
244
+ getSessionStatus: () => Promise<{
245
+ session_id: string;
246
+ status: string;
247
+ is_active: boolean;
248
+ is_paused: boolean;
249
+ event_count: number;
250
+ started_at: string;
251
+ last_activity_at: string;
252
+ duration_seconds: number | null;
253
+ } | null>;
254
+ destroy: () => Promise<void>;
218
255
  getConfig: () => KeverdConfig | null;
219
256
  isReady: () => boolean;
220
257
  } | null, KeverdSDK | {
221
258
  init: (config: KeverdConfig) => void;
222
259
  getVisitorData: (_options?: KeverdVisitorDataOptions) => Promise<KeverdVisitorData>;
223
- destroy: () => void;
260
+ startSession: (userId?: string, deviceHash?: string, metadata?: Record<string, unknown>) => Promise<void>;
261
+ endSession: () => Promise<void>;
262
+ pauseSession: () => Promise<void>;
263
+ resumeSession: () => Promise<void>;
264
+ getSessionStatus: () => Promise<{
265
+ session_id: string;
266
+ status: string;
267
+ is_active: boolean;
268
+ is_paused: boolean;
269
+ event_count: number;
270
+ started_at: string;
271
+ last_activity_at: string;
272
+ duration_seconds: number | null;
273
+ } | null>;
274
+ destroy: () => Promise<void>;
224
275
  getConfig: () => KeverdConfig | null;
225
276
  isReady: () => boolean;
226
277
  } | null>;
package/dist/index.d.ts CHANGED
@@ -93,7 +93,6 @@ interface KeverdVisitorData {
93
93
  }
94
94
  interface KeverdConfig {
95
95
  apiKey: string;
96
- endpoint?: string;
97
96
  userId?: string;
98
97
  debug?: boolean;
99
98
  extendedResult?: boolean;
@@ -101,7 +100,6 @@ interface KeverdConfig {
101
100
  }
102
101
  interface KeverdLoadOptions {
103
102
  apiKey: string;
104
- endpoint?: string;
105
103
  debug?: boolean;
106
104
  }
107
105
  interface KeverdVisitorDataOptions {
@@ -145,18 +143,43 @@ declare class KeverdSDK {
145
143
  * Transform API response to visitor data format
146
144
  */
147
145
  private transformResponse;
148
- /**
149
- * Get default endpoint
150
- */
151
- private getDefaultEndpoint;
152
146
  /**
153
147
  * Generate a session ID
154
148
  */
155
149
  private generateSessionId;
150
+ /**
151
+ * Start a new session (called automatically on init, but can be called manually)
152
+ */
153
+ startSession(userId?: string, deviceHash?: string, metadata?: Record<string, unknown>): Promise<void>;
154
+ /**
155
+ * End the current session
156
+ */
157
+ endSession(): Promise<void>;
158
+ /**
159
+ * Pause the current session (e.g., when app goes to background)
160
+ */
161
+ pauseSession(): Promise<void>;
162
+ /**
163
+ * Resume a paused session (e.g., when app comes to foreground)
164
+ */
165
+ resumeSession(): Promise<void>;
166
+ /**
167
+ * Get current session status
168
+ */
169
+ getSessionStatus(): Promise<{
170
+ session_id: string;
171
+ status: string;
172
+ is_active: boolean;
173
+ is_paused: boolean;
174
+ event_count: number;
175
+ started_at: string;
176
+ last_activity_at: string;
177
+ duration_seconds: number | null;
178
+ } | null>;
156
179
  /**
157
180
  * Destroy the SDK instance
158
181
  */
159
- destroy(): void;
182
+ destroy(): Promise<void>;
160
183
  /**
161
184
  * Get current configuration
162
185
  */
@@ -214,13 +237,41 @@ declare function useKeverdProvider(options: KeverdLoadOptions): {
214
237
  sdk: Ref<{
215
238
  init: (config: KeverdConfig) => void;
216
239
  getVisitorData: (_options?: KeverdVisitorDataOptions) => Promise<KeverdVisitorData>;
217
- destroy: () => void;
240
+ startSession: (userId?: string, deviceHash?: string, metadata?: Record<string, unknown>) => Promise<void>;
241
+ endSession: () => Promise<void>;
242
+ pauseSession: () => Promise<void>;
243
+ resumeSession: () => Promise<void>;
244
+ getSessionStatus: () => Promise<{
245
+ session_id: string;
246
+ status: string;
247
+ is_active: boolean;
248
+ is_paused: boolean;
249
+ event_count: number;
250
+ started_at: string;
251
+ last_activity_at: string;
252
+ duration_seconds: number | null;
253
+ } | null>;
254
+ destroy: () => Promise<void>;
218
255
  getConfig: () => KeverdConfig | null;
219
256
  isReady: () => boolean;
220
257
  } | null, KeverdSDK | {
221
258
  init: (config: KeverdConfig) => void;
222
259
  getVisitorData: (_options?: KeverdVisitorDataOptions) => Promise<KeverdVisitorData>;
223
- destroy: () => void;
260
+ startSession: (userId?: string, deviceHash?: string, metadata?: Record<string, unknown>) => Promise<void>;
261
+ endSession: () => Promise<void>;
262
+ pauseSession: () => Promise<void>;
263
+ resumeSession: () => Promise<void>;
264
+ getSessionStatus: () => Promise<{
265
+ session_id: string;
266
+ status: string;
267
+ is_active: boolean;
268
+ is_paused: boolean;
269
+ event_count: number;
270
+ started_at: string;
271
+ last_activity_at: string;
272
+ duration_seconds: number | null;
273
+ } | null>;
274
+ destroy: () => Promise<void>;
224
275
  getConfig: () => KeverdConfig | null;
225
276
  isReady: () => boolean;
226
277
  } | null>;