Clerk and Prisma entegration

97 views Asked by At

I created a webhook in nextjs with clerk and I add this code into default webhook route

 const sID = evt.data.id || ""

  
  try {
    await prisma.user.create({
        data: {
            id: sID
        },
    });
    } catch (error) {
    console.error('Error creating user in the database:', error);
    return new Response('Database Error', { status: 500 });
    }

But it doesn't work. Whenever I try to create something in prisma it always gives me 404 error

I was expecting to when I log in or create account for first time, prisma adds clerk's user id

0

There are 0 answers