@transmitsecurity/platform-web-sdk 2.0.1 → 2.1.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/drs.d.ts CHANGED
@@ -13,6 +13,13 @@ type EventResponse = {
13
13
  type Recommendation = {
14
14
  type: RecommendationType;
15
15
  };
16
+ type LightweightPayload = {
17
+ clientId: string;
18
+ deviceId?: string;
19
+ userId: string | null;
20
+ sdkPlatform: 'mobile_web' | 'desktop_web';
21
+ events: Array<Record<string, unknown>>;
22
+ };
16
23
 
17
24
  interface ActionResponse {
18
25
  /** The token return by the SDK when the action was reported */
@@ -42,6 +49,8 @@ interface ConstructorOptions {
42
49
  /** @internal
43
50
  * Internal flag indicating this web_sdk instance has its own clientId separate from the Platform SDK root-level clientId */
44
51
  hasOwnClientId?: boolean;
52
+ /** Tier mode for the SDK: 'standard' (default) or 'lightweight' (server-to-server) */
53
+ tier?: 'standard' | 'lightweight';
45
54
  }
46
55
  interface TransactionData {
47
56
  amount: number;
@@ -119,6 +128,7 @@ declare class TSAccountProtection {
119
128
  private identifiersMigrationEnabled;
120
129
  private firstPartyMigrationUrl;
121
130
  private hasOwnClientId;
131
+ private tier;
122
132
  private validationManager;
123
133
  private storageManager;
124
134
  private eventsManager;
@@ -149,6 +159,14 @@ declare class TSAccountProtection {
149
159
  /** @ignore */
150
160
  getActions(): Promise<string[]>;
151
161
  getSessionToken(): Promise<any>;
162
+ getPayload(): Promise<LightweightPayload>;
163
+ clearQueue(): void;
164
+ /**
165
+ * Sets the deviceId for lightweight mode (citadel).
166
+ * Should be called after receiving deviceId from backend on first request.
167
+ * @param deviceId - The JWT deviceId returned from citadel backend
168
+ */
169
+ setDeviceId(deviceId: string): void;
152
170
  /**
153
171
  * Initializes the AccountProtection SDK, which starts automatically tracking and submitting info of the user journey
154
172
  * @param options Init options
@@ -227,6 +245,14 @@ declare const getSessionToken: TSAccountProtection['getSessionToken'];
227
245
  */
228
246
  declare const getSecureSessionToken: TSAccountProtection['getSecureSessionToken'];
229
247
  /** @ignore */
248
+ declare const getPayload: TSAccountProtection['getPayload'];
249
+ /**
250
+ * Sets the deviceId for lightweight mode (citadel).
251
+ * Should be called after receiving deviceId from backend on first request.
252
+ * @param deviceId - The JWT deviceId returned from citadel backend
253
+ */
254
+ declare const setDeviceId: TSAccountProtection['setDeviceId'];
255
+ /** @ignore */
230
256
  declare const __internal: {
231
257
  getDeviceId(): string;
232
258
  getClientId(): string;
@@ -236,4 +262,4 @@ declare const __internal: {
236
262
  declare const PACKAGE_VERSION: string;
237
263
  declare function initialize(config: any): void;
238
264
 
239
- export { ActionEventOptions, ActionResponse, PACKAGE_VERSION, __internal, clearUser, getActions, getSecureSessionToken, getSessionToken, initialize, setAuthenticatedUser, triggerActionEvent };
265
+ export { ActionEventOptions, ActionResponse, LightweightPayload, PACKAGE_VERSION, __internal, clearUser, getActions, getPayload, getSecureSessionToken, getSessionToken, initialize, setAuthenticatedUser, setDeviceId, triggerActionEvent };