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 { authClient } from "@/lib/auth-client"
import { useSignInSocial } from "@better-auth-ui/react"

const { mutate: signInSocial } = useSignInSocial(authClient)

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

Options factory

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

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

Params

Prop

Type

Last updated on

On this page