davidofug/google-auth-with-appwrite

Implement Google Auth with Appwrite

★ 0Forks 1JavaScriptGitHub ↗Compare

README

Appwrite Google Sign-in React App

This project demonstrates a simple React client that uses the Appwrite SDK to authenticate users with Google.

Features:

  • Sign in with Google (Appwrite OAuth)
  • Sign out
  • Protected routes: /dashboard and /profile

Environment variables (add to .env.local):

  • VITE_APPWRITE_PROJECT_ID or APPWRITE_PROJECT_ID — your Appwrite Project ID
  • VITE_APPWRITE_API_KEY or APPWRITE_API_KEY — optional API key
  • VITE_APPWRITE_ENDPOINT — Appwrite endpoint (defaults to http://localhost/v1)

Quick start:

  1. Install dependencies
    npm install
  2. Add values to .env.local.
  3. Start E2E test server
    npm run test:e2e
  4. Start dev server
    npm run dev

Notes:

  • For OAuth to work, configure a Google provider in Appwrite and configure the OAuth redirect URL to include http://localhost:5173/oauth-callback (or the dev server host/port you use).
  • The VITE_ prefixed env vars are used by Vite during build; the plain APPWRITE_ names are kept for compatibility.

Contributors

davidofug

Issues