From 3e8eccc39600e574e5b68015cf8aa03de815f93c Mon Sep 17 00:00:00 2001 From: Oscar Bazaldua <511911+oscb@users.noreply.github.com> Date: Mon, 9 May 2022 18:12:44 -0700 Subject: [PATCH] fix: match identify and reset client methods arguments, add token to context --- packages/core/src/client.tsx | 2 +- packages/core/src/types.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/client.tsx b/packages/core/src/client.tsx index 72a95f766..8b49ac1f1 100644 --- a/packages/core/src/client.tsx +++ b/packages/core/src/client.tsx @@ -64,6 +64,6 @@ export const useAnalytics = (): ClientMethods => { flush: () => client.flush(), group: (...args) => client.group(...args), alias: (...args) => client.alias(...args), - reset: () => client.reset(), + reset: (...args) => client.reset(...args), }; }; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index a1e8eb2de..bf0ebcd56 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -128,11 +128,11 @@ export type Config = { export type ClientMethods = { screen: (name: string, properties?: JsonMap) => void; track: (event: string, properties?: JsonMap) => void; - identify: (userId: string, userTraits?: UserTraits) => void; + identify: (userId?: string, userTraits?: UserTraits) => void; flush: () => Promise; group: (groupId: string, groupTraits?: GroupTraits) => void; alias: (newUserId: string) => void; - reset: () => void; + reset: (resetAnonymousId?: boolean) => void; }; type ContextApp = { @@ -152,6 +152,7 @@ export type ContextDevice = { adTrackingEnabled?: boolean; // ios only advertisingId?: string; // ios only trackingStatus?: string; + token?: string; }; type ContextLibrary = {