zor
zor10mo ago

Clerk webhooks

Are Convex examples page gone? I was looking for Convex Authentication with Clerk and I can't find the Convex docs' page I get the github page but I was looking for the docs page so maybe I was missing a step in webhooks, so I'm stuck on webhooks, Also is that svix one something Convex(Or Convex + Clerk setup) automatically creates, I think I didn't add something like that and project is already new so I would remember(I didn't even know what Svix is)?
No description
21 Replies
Michal Srb
Michal Srb10mo ago
Clerk webhooks use swix
zor
zorOP10mo ago
Sorry, it didn't supposed to be a support thread - I was about to create one
zor
zorOP10mo ago
No description
zor
zorOP10mo ago
I am getting these type errors and when I hover or CTRL + Click it brings me to the dataModel and I can see the export type Doc = any Because of this error, I can't deploy it to Vercel
Michal Srb
Michal Srb10mo ago
Do you have a schema.ts and have you ran npx convex dev ?
zor
zorOP10mo ago
No, I don't and I did but let me run again Oh, actually it' already been running
zor
zorOP10mo ago
No description
zor
zorOP10mo ago
I am confused, I can't set up my Clerk to Convex my DB sync:
No description
zor
zorOP10mo ago
Also stuck at the type I copied that users.ts from your example github repo: https://github.com/get-convex/convex-demos/tree/main/users-and-clerk-webhooks Oh god, adding the schema.ts has solved the type error
zor
zorOP10mo ago
I got seven errors again
No description
zor
zorOP10mo ago
Type '{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; } | null' is not assignable to type '(Omit<{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }, "clerkUser"> & { clerkUser: UserJSON; }) | null'.
Type '{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }' is not assignable to type 'Omit<{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }, "clerkUser"> & { clerkUser: UserJSON; }'.
Property 'clerkUser' is missing in type '{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }' but required in type '{ clerkUser: UserJSON; }'.ts(2322)
users.ts(107, 51): 'clerkUser' is declared here.
Type '{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; } | null' is not assignable to type '(Omit<{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }, "clerkUser"> & { clerkUser: UserJSON; }) | null'.
Type '{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }' is not assignable to type 'Omit<{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }, "clerkUser"> & { clerkUser: UserJSON; }'.
Property 'clerkUser' is missing in type '{ _id: Id<"users">; _creationTime: number; name: string; externalId: string; }' but required in type '{ clerkUser: UserJSON; }'.ts(2322)
users.ts(107, 51): 'clerkUser' is declared here.
Argument of type '"by_clerk_id"' is not assignable to parameter of type '"byExternalId" | keyof SystemIndexes'.ts(2345) etc.
zor
zorOP10mo ago
And I added tsconfig.json and these .js files has generated. Maybe I should create a new project, everything going really bad here. In the meantime I don't really want to bother you
No description
Michal Srb
Michal Srb10mo ago
I think you might have copied that from the older template? This is what the users.ts file looks like in the demo: https://github.com/get-convex/convex-demos/blob/main/users-and-clerk-webhooks/convex/users.ts
GitHub
convex-demos/users-and-clerk-webhooks/convex/users.ts at main · get...
Demo apps built on Convex. Contribute to get-convex/convex-demos development by creating an account on GitHub.
zor
zorOP10mo ago
You are a life saver ❤️ Can't know how happy I am ATM. I was so frustrated yesterday and felt like I wasted 4 hours haha Thank you again, I love Convex. Do you have any idea where am I doing wrong?
zor
zorOP10mo ago
No description
zor
zorOP10mo ago
No description
zor
zorOP10mo ago
GitHub
convex-demos/users-and-clerk-webhooks at main · get-convex/convex-d...
Demo apps built on Convex. Contribute to get-convex/convex-demos development by creating an account on GitHub.
zor
zorOP10mo ago
My webhook url doesn't work I always get 404 when I send to https://myownconvexthing.convex.cloud/clerk-users-webhook
zor
zorOP10mo ago
Is that normal?
No description
zor
zorOP10mo ago
Changing the convex.cloud to .convex.site has fixed it. I love when an error completely ruins my day and give headache then finding out the simplest thing at the end. Anyways it stacks the dopamine for the win
No description
Michal Srb
Michal Srb10mo ago
Yes, unfortunately the webhooks setup is many steps that have to be done exactly correctly. This is why we haven't been pushing everyone using Clerk+Convex to adopt them.

Did you find this page helpful?