UNPKG

1.58 kBTypeScriptView Raw
1import { IdentifyUserInput } from '../types';
2/**
3 * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
4 * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
5 * the same `userId`.
6 *
7 * @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
8 * API.
9 *
10 * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.
11 * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library
12 * configuration is incorrect.
13 *
14 * @returns A promise that will resolve when the operation is complete.
15 *
16 * @example
17 * ```ts
18 * // Identify a user with Pinpoint
19 * await identifyUser({
20 * userId,
21 * userProfile: {
22 * email: 'userEmail@example.com'
23 * customProperties: {
24 * phoneNumber: ['555-555-5555'],
25 * },
26 * }
27 * });
28 * ```
29 *
30 * @example
31 * ```ts
32 * // Identify a user with Pinpoint with some additional demographics
33 * await identifyUser({
34 * userId,
35 * userProfile: {
36 * email: 'userEmail@example.com'
37 * customProperties: {
38 * phoneNumber: ['555-555-5555'],
39 * },
40 * demographic: {
41 * platform: 'ios',
42 * timezone: 'America/Los_Angeles'
43 * }
44 * }
45 * });
46 */
47export declare const identifyUser: ({ userId, userProfile, options, }: IdentifyUserInput) => Promise<void>;