fullstorydev / fullstory-browser-sdk

Official FullStory SDK for JavaScript, for web browsers
MIT License
55 stars 17 forks source link

identify should allow boolean #48

Closed acharlop closed 4 years ago

acharlop commented 4 years ago

FS.identify(false) has a linting error

Argument of type 'false' is not assignable to parameter of type 'string'.

While the Docs show it as the correct way to anonymize a user

patrick-fs commented 4 years ago

Hey @acharlop thanks for bringing this to our attention.

We actually plan on deprecating identify(false) in the core FullStory snippet and replacing it with with an anonymize() function. identify(false) won't be removed, but we plan on no longer recommending its use.

I've already implemented anonymize() in the package, but as you can see, it still depends on identify(false).

The interface is currently defined the way we want:

export function anonymize(): void;
...
export function identify(uid: string, customVars?: UserVars): void;

I'd rather keep the interface the way it is to reflect our recommended use. As soon as the core snippet is updated with anonymize(), identify(false) will no longer be invoked in the code. As a temporary measure, how would you feel about ignoring that linter rule on the line of code that's causing the error?

acharlop commented 4 years ago

I will use anonymize() thank you

patrick-fs commented 4 years ago

Hey @acharlop as an update, FS.anonymize() is live in the core snippet and our KB article has been updated (https://help.fullstory.com/hc/en-us/articles/360020828113-FS-identify-Identifying-users). Thanks for your help!