client.auth.signInWithOAuth
Sign in via an OAuth provider (Google, GitHub).
Signature
class Client {
auth: {
signInWithOAuth(input: { provider: string; redirectUrl?: string }): Promise<{ url: string }>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| string | yes | Provider ID: , |
| string | no | Post-auth redirect (defaults to current origin) |
Examples
const { url } = await bf.auth.signInWithOAuth({ provider: 'google' })
window.location.href = url
Throws
| Error | Condition |
|---|---|
| API request failed |
| Network issue |
Pitfalls
- Redirect must match — the redirect URL must be registered in your auth provider config
- Popup blockers — if calling from browser context, ensure the redirect is not blocked
See also
{auto-injected}
Tested against
{auto-injected}