Skip to content

Documentation / expo / useLinkWithOAuth

Function: useLinkWithOAuth() ​

useLinkWithOAuth(opts?): UseLinkWithOAuth

Returns a link function to initiate an oauth link flow, as well as the current state of the oauth flow

Parameters ​

• opts?: OAuthHookOptions

Returns ​

UseLinkWithOAuth

Example ​

ts
// Somewhere within a component tree wrapped with <PrivyProvider />
const {link, state} = useLinkWithOAuth()

// Kick off an oauth flow
<Button onPress={() => link({ provider: 'google' })} />

// Show a spinner during the transition
{state.status === 'loading' && <Spinner />}