The Startup Template
  • The Startup Template
  • Contributing to The Startup Template
  • Contributor Covenant Code of Conduct
  • 📘Tutorials
    • Playground builder
    • Enabling Authentication
    • Setting Up Email Notifications
    • Connecting to EdgeDB Cloud
    • Theming & Components
    • Common errors
Powered by GitBook
On this page
  • Enable Google Login
  • Enable GitHub Login
  • Example .env File
  • Additional Resources
  • Need Help?

Was this helpful?

Edit on GitHub
  1. Tutorials

Enabling Authentication

To enable authentication with GitHub and Google in your project, follow these steps to set up the necessary environment variables.

PreviousPlayground builderNextSetting Up Email Notifications

Last updated 1 year ago

Was this helpful?

Enable Google Login

  1. Create Credentials on Google Cloud Console:

    • Go to .

    • Create a new project or select an existing one.

    • Navigate to "APIs & Services" > "OAuth consent screen".

    • Configure the consent screen for your project.

    • Go to "Credentials" > "Create Credentials" > "OAuth 2.0 Client IDs".

    • Fill in the required details and create the credentials.

    • Obtain your GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.

  2. Add to .env File:

    • Open your .env file and add the following:

    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret

Enable GitHub Login

  1. Create a GitHub Application:

    • Click on "New OAuth App".

    • Fill in the required details and register your application.

    • Obtain your GITHUB_ID and GITHUB_SECRET.

  2. Add to .env File:

    • Open your .env file and add the following:

    GITHUB_ID=your_github_client_id
    GITHUB_SECRET=your_github_client_secret

Example .env File

Here is an example of what your .env file should look like after adding both Google and GitHub credentials:

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_ID=your_github_client_id
GITHUB_SECRET=your_github_client_secret

Additional Resources


Need Help?

Happy coding!

Go to .

Test Authentication: Open in your browser and test the Google and GitHub login functionalities.

If you have any feedback or run into any issues, don't hesitate to reach out at .

📘
GitHub Developer Settings
http://localhost:3000
NextAuth.js Documentation
nparashar150@gmail.com
Google Cloud Console
GCP screenshot
Github custom oauth app creation screen
Github custom oauth oauth app token generation