Johan S.J
Convex Community3mo ago
7 replies
Johan S.

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.
Add Convex to a Svelte project
Svelte Quickstart | Convex Developer Hub
Built-in authentication for Convex applications
Convex Auth | Convex Developer Hub
Was this page helpful?