This repository demonstrates how to implement Google OneTap authentication in a NextJS v14 app using the App Router.
To get started, you'll need to create a Google Application. Follow the steps in this guide to set up your application and obtain your Client ID.
Once you have your Client ID, copy it and follow these steps:
- Rename the
template.env.local
file to.env.local
. - Open the
.env.local
file and add your Client ID as follows:
NEXT_PUBLIC_GOOGLE_CLIENT_ID=YOUR_CLIENT_ID_HERE
Make sure your application is running on an HTTPS URL that has been authorized in your Google API Console. This is necessary for the Google OneTap feature to work correctly.
To use the Google OneTap authentication in your NextJS v14 project, follow these steps:
- Clone the repository:
git clone https://github.com/slxca/google-onetap-nextjs.git
- Install the dependencies:
cd google-onetap-nextjs
npm install
- Start the development server:
npm run dev
- Open your application in the browser. You should see the Google OneTap prompt appear.
We welcome contributions! Please feel free to submit issues, fork the repository, and open pull requests.
If you find this project helpful, please consider supporting us by sponsoring on GitHub: github.com/sponsors/slxca.
Thank you for your interest in our project! We hope it helps you implement Google OneTap authentication in your NextJS applications.