Use the hook useProviderLink to get an OAuth provider URL that can be used to sign in users.

const providerLink = useProviderLink()

Parameters


options optional ProviderOptions


Examples

const providerLink = useProviderLink()

Pass in the connect option to connect the user’s account to the OAuth provider when different emails are used.

const providerLink = useProviderLink({ connect: true })
import { useProviderLink } from '@nhost/react'

const Component = () => {
  const { facebook, github } = useProviderLink()

  return (
    <div>
      <a href={facebook}>Sign in with Facebook</a>
      <a href={github}>Sign in with GitHub</a>
    </div>
  )
}