handleProviderSignIn
Sign in with a third-party provider (Google, GitHub, Twitter, Facebook).
Usage
Uses a popup flow. For React Native, use refirebase/native. Returns { data, error } instead of throwing.
Example
import { auth } from 'refirebase';
const { data, error } = await auth.handleProviderSignIn('google', {
scopes: ['https://www.googleapis.com/auth/calendar.readonly']
});
if (error) {
console.error('Sign in failed:', error);
} else {
console.log('Signed in as:', data?.user.email);
}Parameters
| Param | Type | Description |
|---|---|---|
provider* | 'google' | 'github' | 'twitter' | 'facebook' | The third-party authentication provider. |
options | { scopes?: string[] } | Additional options, such as OAuth scopes. |
Return value
Returns
Promise<{ data: UserCredential | null, error?: RefirebaseError }>An object containing the user credential data on success, or an error object on failure.