From bdd5399e57dab5459b85721e31a8f03056605a6f Mon Sep 17 00:00:00 2001 From: Nick Giancola Date: Sat, 27 Apr 2019 11:06:18 -0700 Subject: [PATCH] identify should accept null for memberId, to match API of underlying native libs In the documentation it says "If you don't have a userId but want to record traits, you should pass nil." but the type signature is enforcing no nulls. --- packages/core/src/analytics.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/analytics.ts b/packages/core/src/analytics.ts index 910af563d..ee2459ae2 100644 --- a/packages/core/src/analytics.ts +++ b/packages/core/src/analytics.ts @@ -235,7 +235,7 @@ export module Analytics { * For more information on how we generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids * @param traits A dictionary of traits you know about the user. Things like: email, name, plan, etc. */ - public async identify(user: string, traits: JsonMap = {}) { + public async identify(user: string | null, traits: JsonMap = {}) { await this.middlewares.run('identify', { user, traits }) }