Do not use the @tanker/fake-authentication package in production. Instead, please consult the guide on user management.

Installation and usage

See Core documentation for instructions on how to install and use the @tanker/fake-authentication package.


const config = { appId: 'your-app-id' };
const fakeAuth = new FakeAuthentication(config);
Parameters Description
config: Object The configuration of this FakeAuthentication instance, containing:
config.appId: string The app ID


This documentation uses flow type annotations.


An object that contains the private identity of a user.

Fields Description
identity: string The private identity of a user. Needed to start a Tanker session
provisionalIdentity: string The provisional identity of the user (if there is one) (optional)


Returns the private identity associated with the provided email. It is guaranteed that this function will always return the same private identity given an email. If getPublicIdentities() is called before getIdentity() for a given email, the private identity also contains a provisional identity. If no email is provided it generates a disposable identity.

function getIdentity(email?: string) : Promise<PrivateIdentity>
Parameters Description
email?: string The email address corresponding to the identity to retrieve (optional)
Promise<PrivateIdentity> The identity corresponding to the given email


Returns an array of public identities from an array of emails.

function getPublicIdentities(email: Array<string>) : Promise<Array<string>>
Parameters Description
emails: Array The emails addresses corresponding to the public identities to retrieve
Promise> The public identities corresponding to the given emails


Notifies the fake authentication server than an identity has been registered.

function setIdentityRegistered(email: string) : Promise<void>
Parameters Description
email: string email corresponding to the identity to notify as registered
Promise The promise is fulfilled once the fake authentication server responded