Back

How to use google account to sign in

  • 0
  • Web
ijay
17 May, 2023, 08:44

How can I get the user to sign up or login using their Google account?

TL;DR
The user wants to know how to use a Google account to sign in. The thread includes some code snippets and questions about project IDs and API keys. The solution is to set up Google as an OAuth provider in the appwrite project and then use the provided link for login/signup.
safwan
17 May, 2023, 09:57

You'll need to setup Google as an OAuth provider in your appwrite project. After it's set up, use https://appwrite.io/docs/client/account?sdk=web-default#accountCreateOAuth2Session for login/signup

ijay
17 May, 2023, 10:04

Okay thank you will check it out

ijay
17 May, 2023, 16:29

please is it necessary i hid my API key and if it is how do i hid it? thank u

Vedsaga
17 May, 2023, 16:33

which API key are you reffering could you pls clarify? are you referring to the one which is console for server side sdk?

Vedsaga
17 May, 2023, 16:34

btw general idea is to never share any keys till it's not explicilty get asked

ijay
17 May, 2023, 16:38

The one i kept in my appwriteconfig file- account creation

safwan
17 May, 2023, 16:41

you mean the project id?

safwan
17 May, 2023, 16:41
TypeScript
client
    .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
;

const promise = account.create('[USER_ID]', 'email@example.com', '');
safwan
17 May, 2023, 16:42

.setProject('5df5acd0d48c2') <------- is this what you're talking about?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more