BETTER-AUTH. UI
Mutations

useSignInSocial

Start a social (OAuth) sign-in flow.

Initiates the OAuth redirect flow — the session lands once the provider redirects back, so no session-cache side effects run here.

Usage

import { useAuth, useSignInSocial } from "@better-auth-ui/react"

const { authClient } = useAuth()
const { mutate: signInSocial } = useSignInSocial(authClient)

signInSocial({
  provider: "github",
  callbackURL: "/dashboard"
})

Options factory

import { signInSocialOptions } from "@better-auth-ui/react"
import { useMutation } from "@tanstack/react-query"

const { mutate } = useMutation(signInSocialOptions(authClient))

Params

Prop

Type

Last updated on

On this page