Authenticating Users via Social Auth
This guide assumes you have already followed the Setup Guide and have set up the Alchemy Account Provider using this guide. Please refer to the guides above for more information on how to properly setup your project.
For a complete example of how we can setup a project and use the various available authentication methods, please refer to our quickstart example.
Authenticate a User via Social Auth
To authenticate a user via social auth, use the authenticate()
function from the useAuthenticate()
hook with the type
set to OAuth
, the redirectUrl
set to your app’s deep link, the mode
set to redirect
and the authProviderId
set to the social auth provider you want to use.
Here is an example, authenticating a user via Google:
Ensure that you have added your app’s scheme to your Whitelisted Origins
in
the Alchemy Dashboard.