Follow these steps to enable Google sign-in through Supabase for HyperMemo.
- Open the Google Cloud Console for the project tied to HyperMemo.
- Create a new OAuth 2.0 Client ID (type Web application).
- Add the following redirect URIs:
https://<YOUR_EXTENSION_ID>.chromiumapp.org/(Chrome Identity flow)https://<PROJECT_REF>.supabase.co/auth/v1/callback(Supabase hosted callback)
- Copy the generated Client ID and Client Secret.
- Supabase Dashboard → Authentication → Providers → Google.
- Toggle Google on, paste the Client ID and Client Secret, then save.
- (Optional) verify “Site URL” in Authentication → URL Configuration matches your deployed domain.
- In
.env/.env.local, setVITE_GOOGLE_OAUTH_CLIENT_ID=<Client ID>. - Rebuild or restart the dev server so the popup service picks up the value.
- Chrome extension: "Sign in with Google" triggers
chrome.identity.launchWebAuthFlow, which returns an ID token exchanged viasupabase.auth.signInWithIdToken. - Non-extension fallback: Supabase falls back to
signInWithOAuth('google'), redirecting throughhttps://<PROJECT_REF>.supabase.co/auth/v1/callback.
Set the following secrets for production:
# Webhook secret for database trigger → Edge Function communication
supabase secrets set WEBHOOK_SECRET=<generate-a-secure-random-string>
# Restrict CORS to your Chrome extension origin (recommended for production)
supabase secrets set ALLOWED_ORIGINS=chrome-extension://<YOUR_EXTENSION_ID>To get your extension ID:
- Load the extension in Chrome (
chrome://extensions) - Copy the ID shown under your extension name
All Edge Functions except process-bookmark require valid JWT tokens (configured in supabase/config.toml):
| Function | JWT Required | Notes |
|---|---|---|
| bookmarks | Yes | CRUD operations |
| tags | Yes | Tag management |
| summaries | Yes | AI summary generation |
| rag_query | Yes | RAG search and chat |
| notes | Yes | Note generation |
| process-bookmark | No | Accepts webhook calls from database trigger |
By default, CORS allows all origins (*) for development. In production:
- Set
ALLOWED_ORIGINSto restrict access to your extension - Multiple origins can be comma-separated:
chrome-extension://abc,chrome-extension://xyz - If not set, falls back to permissive mode (not recommended for production)