@clianta/sdk 1.6.0 → 1.6.1

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/react.d.ts CHANGED
@@ -1,36 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, ErrorInfo } from 'react';
3
3
 
4
- /**
5
- * Clianta SDK - CRM API Client
6
- * @see SDK_VERSION in core/config.ts
7
- */
8
-
9
- type InboundEventType = 'user.registered' | 'user.updated' | 'user.subscribed' | 'user.unsubscribed' | 'contact.created' | 'contact.updated' | 'purchase.completed';
10
- interface InboundEventPayload {
11
- /** Event type (e.g. "user.registered") */
12
- event: InboundEventType;
13
- /** Contact data — at least email or phone is required */
14
- contact: {
15
- email?: string;
16
- phone?: string;
17
- firstName?: string;
18
- lastName?: string;
19
- company?: string;
20
- jobTitle?: string;
21
- tags?: string[];
22
- };
23
- /** Optional extra data stored as customFields on the contact */
24
- data?: Record<string, unknown>;
25
- }
26
- interface InboundEventResult {
27
- success: boolean;
28
- contactCreated: boolean;
29
- contactId?: string;
30
- event: string;
31
- error?: string;
32
- }
33
-
34
4
  /**
35
5
  * Clianta SDK - Type Definitions
36
6
  * @see SDK_VERSION in core/config.ts
@@ -40,10 +10,6 @@ interface CliantaConfig {
40
10
  projectId?: string;
41
11
  /** Backend API endpoint URL */
42
12
  apiEndpoint?: string;
43
- /** Auth token for server-side API access (user JWT) */
44
- authToken?: string;
45
- /** Workspace API key for server-to-server access (use instead of authToken for external apps) */
46
- apiKey?: string;
47
13
  /** Enable debug mode with verbose logging */
48
14
  debug?: boolean;
49
15
  /** Automatically track page views on load and navigation */
@@ -191,24 +157,6 @@ interface TrackerCore {
191
157
  onReady(callback: () => void): void;
192
158
  /** Check if the SDK is fully initialized and ready */
193
159
  isReady(): boolean;
194
- /** Get the current visitor's profile from the CRM */
195
- getVisitorProfile(): Promise<VisitorProfile | null>;
196
- /** Get the current visitor's recent activity */
197
- getVisitorActivity(options?: VisitorActivityOptions): Promise<{
198
- data: VisitorActivity[];
199
- pagination: {
200
- page: number;
201
- limit: number;
202
- total: number;
203
- pages: number;
204
- };
205
- } | null>;
206
- /** Get a summarized journey timeline for the current visitor */
207
- getVisitorTimeline(): Promise<VisitorTimeline | null>;
208
- /** Get engagement metrics for the current visitor */
209
- getVisitorEngagement(): Promise<EngagementMetrics | null>;
210
- /** Send a server-side inbound event (requires apiKey in config) */
211
- sendEvent(payload: InboundEventPayload): Promise<InboundEventResult>;
212
160
  /** Create or update a contact by email (upsert) */
213
161
  createContact(data: PublicContactData): Promise<PublicCrmResult>;
214
162
  /** Update an existing contact by ID (limited fields) */
@@ -220,76 +168,6 @@ interface TrackerCore {
220
168
  /** Create an opportunity (e.g., from "Request Demo" forms) */
221
169
  createOpportunity(data: PublicOpportunityData): Promise<PublicCrmResult>;
222
170
  }
223
- interface VisitorProfile {
224
- visitorId: string;
225
- contactId?: string;
226
- email?: string;
227
- firstName?: string;
228
- lastName?: string;
229
- company?: string;
230
- jobTitle?: string;
231
- phone?: string;
232
- status?: string;
233
- lifecycleStage?: string;
234
- tags?: string[];
235
- leadScore?: number;
236
- firstSeen?: string;
237
- lastSeen?: string;
238
- sessionCount?: number;
239
- pageViewCount?: number;
240
- totalTimeSpent?: number;
241
- customFields?: Record<string, unknown>;
242
- }
243
- interface VisitorActivity {
244
- _id?: string;
245
- eventType: string;
246
- eventName: string;
247
- url: string;
248
- properties?: Record<string, unknown>;
249
- timestamp: string;
250
- }
251
- interface VisitorTimeline {
252
- visitorId: string;
253
- contactId?: string;
254
- firstSeen: string;
255
- lastSeen: string;
256
- totalSessions: number;
257
- totalPageViews: number;
258
- totalEvents: number;
259
- totalTimeSpentSeconds: number;
260
- averageSessionDurationSeconds: number;
261
- topPages: Array<{
262
- url: string;
263
- views: number;
264
- avgTimeSeconds?: number;
265
- }>;
266
- recentActivities: VisitorActivity[];
267
- devices: Array<{
268
- userAgent: string;
269
- lastSeen: string;
270
- }>;
271
- }
272
- interface EngagementMetrics {
273
- visitorId: string;
274
- totalTimeOnSiteSeconds: number;
275
- averageSessionDurationSeconds: number;
276
- totalPageViews: number;
277
- totalSessions: number;
278
- engagementScore: number;
279
- bounceRate: number;
280
- lastActiveAt: string;
281
- topEvents: Array<{
282
- eventType: string;
283
- count: number;
284
- }>;
285
- }
286
- interface VisitorActivityOptions {
287
- page?: number;
288
- limit?: number;
289
- eventType?: string;
290
- startDate?: string;
291
- endDate?: string;
292
- }
293
171
  interface PublicContactData {
294
172
  email: string;
295
173
  firstName?: string;