Skip to content

Commit 1e4675d

Browse files
patbenatarNick Giancolabsneed
authored
identify should accept null for memberId, to match API of underlying native libs (#65)
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. Co-authored-by: Nick Giancola <[email protected]> Co-authored-by: Brandon Sneed <[email protected]>
1 parent e2b6bc8 commit 1e4675d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export module Analytics {
301301
* @param traits A dictionary of traits you know about the user. Things like: email, name, plan, etc.
302302
* @param options A dictionary of options, e.g. integrations (thigh analytics integration to forward the event to)
303303
*/
304-
public async identify(user: string, traits: JsonMap = {}, options: Options = {}) {
304+
public async identify(user: string | null, traits: JsonMap = {}, options: Options = {}) {
305305
await this.middlewares.run('identify', { user, traits, options, integrations: options.integrations || {} }, options.context || {})
306306
}
307307

0 commit comments

Comments
 (0)