Authentication and Permissions
Google OAuth
Instant supports logging in your users with their Google account. We support flows for Web and React Native. Follow the steps below to get started.
Step 1: Configure OAuth consent screen Go to the Google Console.
Click "CONFIGURE CONSENT SCREEN." If you already have a consent screen, you can skip to the next step.
Select "External" and click "CREATE".
Add your app's name, a support email, and developer contact information. Click "Save and continue".
No need to add scopes or test users. Click "Save and continue" for the next screens. Until you reach the "Summary" screen, click "Back to dashboard".
Step 2: Create an OAuth client for Google From Google Console, click "+ CREATE CREDENTIALS"
Select "OAuth client ID"
Select "Web application" as the application type.
Add https://api.instantdb.com/runtime/oauth/callback
as an Authorized redirect URI.
If you're testing from localhost, add both http://localhost
and http://localhost:3000
to "Authorized JavaScript origins", replacing 3000
with the port you use. For production, add your website's domain.
Step 3: Register your OAuth client with Instant
Go to the Instant dashboard and select the Auth
tab for your app.
Register a Google client and enter the client id and client secret from the OAuth client that you created.
Step 4: Register your website with Instant
In the Auth
tab, add the url of the websites where you are using Instant to the Redirect Origins. If you're testing from localhost, add http://localhost:3000
, replacing 3000
with the port you use. For production, add your website's domain.
Step 5: Add login to your app
The next sections will show you how to use your configured OAuth client with Instant.
Native Button (Web)
Use Google's pre-styled button to sign in. Using this method you can render your custom app name in the consent screen (Recommended)
Redirect flow (Web)
Easier to integrate, but doesn't let you render your custom app name.
React Native
Add Google OAuth to your RN app with our webflow integration.