Identity.login() is used when an anonymous user has provided identifying information to a client-side application. When called with an identifyRequest object containing user identities such as Email or Customer ID, mParticle will first lookup an MPID, a unique 64-bit signed integer identifying a user, then use that MPID to retrieve a user profile containing user identities and user attributes.
Identity.modify() is used when a known user wishes to change the Identity they are associated with. For example, if a user wishes to change their email, Identity.modify() would be the proper method to use. Identity.modify() should not be used to manage login state.
Improper use example: A user logs out of your application and you call Identity.modify to change their User Identity to null. This is not a correct implementation. Use modify only when a user wishes to use a new Identity value for identification purposes.
To learn more, please visit our docs.