Skip to content

User Login with Google

In this guide, you will learn how an app that builds a custom login UI and integrates with the Arcana Auth SDK can easily onboard users via Google as the authentication provider.

Prerequisites

Steps

Using Google to onboard users in a Web3 app that is integrated with the Arcana Auth SDK is simple!

Just a single line of code!

Step 1: Call loginWithSocial function

Make sure that all the prerequisites listed above are met. The app should be successfully registered, configured, and integrated with the Arcana Auth SDK, before adding code to onboard users via Google.

await auth.loginWithSocial('google')

Check if a user is logged in:

const connected = await auth.isLoggedIn()

Add code in the app to log out an authenticated user:

await auth.logout()

That is all!

The Web3 app is all set for onboarding users via Google.

What's Next?

After onboarding app users via Google, you can allow authenticated users to access the Arcana wallet for signing blockchain transactions on any supported blockchain network. Plug in other Arcana Auth SDK functions in the app code such as getting the authenticated user's account details, performing Web3 wallet operations, etc. See Arcana Auth SDK Usage Guide and Arcana wallet Developer's Guide for details.

See also


Last update: May 25, 2023 by shaloo