The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/auth > signInWithCustomToken

signInWithCustomToken() function

Asynchronously signs in using a custom token.

Signature:

export declare function signInWithCustomToken(auth: Auth, customToken: string): Promise<UserCredential>;

Parameters

Parameter Type Description
auth Auth The Auth instance.
customToken string The custom token to sign in with.

Returns:

Promise<UserCredential>

Description

Custom tokens are used to integrate Firebase Auth with existing auth systems, and must be generated by an auth backend using the createCustomToken method in the Admin SDK .

Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service.