Is it possible to call a mutation in a Next.js API route?
I am trying to implement Stripe Oauth into my Next.js app. I get the users user id and access tokens from an api route, /api/stripe/verify.
When I get those values I wanted to create a row in my convex table, but the only way it work is with use client.
Wanted to know what the best approach for this is. Here is the code I'm referring too
2 Replies
Have you tried
fetchMutation
?
You can check the docs in here, https://docs.convex.dev/client/react/nextjs/server-renderingNext.js Server Rendering | Convex Developer Hub
Next.js automatically renders both Client and Server Components on the server
Yup that's what I was looking for, perfect! Convex is the GOAT , thanks @Rayy !