voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
32 lines (18 loc) • 1.16 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/auth](./auth.md) > [signInWithCustomToken](./auth.signinwithcustomtoken.md)
## signInWithCustomToken() function
Asynchronously signs in using a custom token.
<b>Signature:</b>
```typescript
export declare function signInWithCustomToken(auth: Auth, customToken: string): Promise<UserCredential>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| auth | [Auth](./auth.auth.md) | The Auth instance. |
| customToken | string | The custom token to sign in with. |
<b>Returns:</b>
Promise<[UserCredential](./auth.usercredential.md)<!-- -->>
## Remarks
Custom tokens are used to integrate Firebase Auth with existing auth systems, and must be generated by an auth backend using the [createCustomToken](https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth#createcustomtoken) method in the [Admin SDK](https://firebase.google.com/docs/auth/admin) .
Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service.