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 > FacebookAuthProvider > credential

FacebookAuthProvider.credential() method

Creates a credential for Facebook.

Signature:

static credential(accessToken: string): OAuthCredential;

Parameters

Parameter Type Description
accessToken string Facebook access token.

Returns:

OAuthCredential

Example

// `event` from the Facebook auth.authResponseChange callback.
const credential = FacebookAuthProvider.credential(event.authResponse.accessToken);
const result = await signInWithCredential(credential);