BlueForge Docs

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

NameTypeRequiredNotes
provider
stringyesProvider ID:
google
,
github
redirectUrl
stringnoPost-auth redirect (defaults to current origin)

Examples

const { url } = await bf.auth.signInWithOAuth({ provider: 'google' })
window.location.href = url

Throws

ErrorCondition
ApiError
API request failed
NetworkError
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}