Skip to content

Documentation / expo / useOAuthFlow

Function: useOAuthFlow()

useOAuthFlow(opts?): OAuthFlowHookResult

Parameters

opts?: OAuthHookOptions

Returns

OAuthFlowHookResult

Deprecated

use useLoginWithOAuth or useLinkWithOAuth

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

Example

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

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

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