Johan S.
Johan S.4w ago

Issues getting convex auth to Sveltekit

Ive followed the svelte quickstart https://docs.convex.dev/quickstart/svelte And Im getting the tasks as Im supposed to but when Ive added google oath via convex auth https://docs.convex.dev/auth/convex-auth I run into problems logging in. Ive tried using: import { useConvexClient } from 'convex-svelte'; import { api } from '../../../convex/_generated/api'; import { signInViaProvider } from '@convex-dev/auth/server'; But I get the same error: "process is not defined...at convex/auth.ts" Which is weird because I need to add the env vars import Google from '@auth/core/providers/google'; import { convexAuth } from '@convex-dev/auth/server'; export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({ providers: [ Google({ clientId: process.env.AUTH_GOOGLE_ID, clientSecret: process.env.AUTH_GOOGLE_SECRET }) ] }); Im migrating over from a supabase project and there the google oath works flawlessly so there is no issue with that.
Svelte Quickstart | Convex Developer Hub
Add Convex to a Svelte project
Convex Auth | Convex Developer Hub
Built-in authentication for Convex applications
7 Replies
Convex Bot
Convex Bot4w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart4w ago
Can you share the stack trace from the process undefined error
Johan S.
Johan S.OP4w ago
Sure
Johan S.
Johan S.OP4w ago
No description
erquhart
erquhart4w ago
Looks like you're executing server code via click handler, hence process not being defined
erquhart
erquhart4w ago
There's a community maintained Svelte/SvelteKit adapter for Convex Auth, recommend checking that out: https://github.com/mmailaender/convex-auth-svelte
GitHub
GitHub - mmailaender/convex-auth-svelte
Contribute to mmailaender/convex-auth-svelte development by creating an account on GitHub.
Johan S.
Johan S.OP4w ago
Thanks dude! I also saw Micas post about better auth maybe being better, so Im gonna try to do that one, but thanks for your help! And really quick respons

Did you find this page helpful?