crexperium-sdk 1.2.2 → 1.2.3
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/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.js +35 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -3
- package/dist/index.mjs.map +1 -1
- package/dist/resources/contacts.d.ts +32 -1
- package/dist/types/contacts.d.ts +12 -2
- package/package.json +1 -1
|
@@ -5,7 +5,38 @@ import { BaseResource } from './base';
|
|
|
5
5
|
import { Contact, IdentifyOptions, IdentifyResponse, ContactFilters, CreateContactInput, PaginatedResponse } from '../types';
|
|
6
6
|
export declare class ContactsResource extends BaseResource {
|
|
7
7
|
/**
|
|
8
|
-
* Identify a contact (create or update)
|
|
8
|
+
* Identify a contact (create or update by multiple identifiers)
|
|
9
|
+
*
|
|
10
|
+
* Accepts at least ONE of: externalId, visitorId, email, or phone
|
|
11
|
+
* Priority: externalId > visitorId > email > phone
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Identify by external ID (after login)
|
|
15
|
+
* await client.contacts.identify({
|
|
16
|
+
* externalId: 'user_123',
|
|
17
|
+
* email: 'user@example.com',
|
|
18
|
+
* firstName: 'John'
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Identify by visitor ID (anonymous → known)
|
|
23
|
+
* await client.contacts.identify({
|
|
24
|
+
* visitorId: client.visitorId.getVisitorId(),
|
|
25
|
+
* email: 'user@example.com'
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Identify by email only
|
|
30
|
+
* await client.contacts.identify({
|
|
31
|
+
* email: 'user@example.com',
|
|
32
|
+
* firstName: 'John'
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Identify by phone only
|
|
37
|
+
* await client.contacts.identify({
|
|
38
|
+
* phone: '+1234567890'
|
|
39
|
+
* });
|
|
9
40
|
*/
|
|
10
41
|
identify(options: IdentifyOptions): Promise<IdentifyResponse>;
|
|
11
42
|
/**
|
package/dist/types/contacts.d.ts
CHANGED
|
@@ -25,12 +25,22 @@ export interface Contact {
|
|
|
25
25
|
updated_at: string;
|
|
26
26
|
last_activity_at?: string;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Identify options - requires at least ONE identifier:
|
|
30
|
+
* - externalId: Your app's user ID (e.g., "user_123")
|
|
31
|
+
* - visitorId: SDK's auto-generated visitor ID (from client.visitorId.getVisitorId())
|
|
32
|
+
* - email: User's email address
|
|
33
|
+
* - phone: User's phone number
|
|
34
|
+
*
|
|
35
|
+
* Priority: externalId > visitorId > email > phone
|
|
36
|
+
*/
|
|
28
37
|
export interface IdentifyOptions {
|
|
29
|
-
externalId
|
|
38
|
+
externalId?: string;
|
|
39
|
+
visitorId?: string;
|
|
30
40
|
email?: string;
|
|
41
|
+
phone?: string;
|
|
31
42
|
firstName?: string;
|
|
32
43
|
lastName?: string;
|
|
33
|
-
phone?: string;
|
|
34
44
|
title?: string;
|
|
35
45
|
company?: string;
|
|
36
46
|
website?: string;
|