convex dodopayments component issue
Hey everyone
I’m testing the new https://www.convex.dev/components/dodopayments (DodoPayments integration) with Convex.
My setup:
Next.js + TypeScript
Convex + Clerk
DodoPayments official Convex component docs
Problem:
Inside my convex/dodo.ts, Convex doesn’t recognize ctx.db inside the identify callback.
TypeScript error:
Property 'db' does not exist on type 'GenericActionCtx<any>'
I’ve already tried adding:
- import type { MutationCtx } from "./_generated/server"
- explicit (ctx: MutationCtx)
- running npx convex dev again and again
But Convex still doesn’t recognize ctx.db within identify.
Can anyone from the Convex team confirm the correct context type or best practice for using ctx.db inside DodoPayments identify?
thanks in advance.Convex
Dodo Payments
Dodo Payments is your complete solution for billing and payments, purpose-built for AI and SaaS applications.


9 Replies
Looks like the docs are a bit off, that identify function will always only get an action ctx, (it requires it to use ctx.runAction) which doesn't have db access. What you can do is make a query and call it from the identify function via
ctx.runQuery().Got it! Thanks a lot 🙌
I’ll try using ctx.runQuery() as you suggested.
Also noticed another thing — in the docs example (convex/dodo.ts), the export line seems to appear twice.
Probably just a small typo.
Really appreciate the quick help — learned a lot from this!

Actually, In this component's docs, the webhook handling also has issues, because according to the docs this component uses "createDodoWebhookHandler " to handle the webhooks, which does NOT contain any ctx,
So now, how can someone perform any mutation or query in convex db without the ctx???

ah yeah the ctx isn't passed through 🤦♂️
This is maintained by the Dodo team, if you open an issue on their repo they can take it from there. The issues you've mentioned here all appear valid.
Thanks for the immediate response.
i have reported the issues on their discord server
Hey, all three issues are now resolved, ctx is now passed as the first parameter to all webhook handlers and the documentation has been corrected.
Thanks for reporting!
How do we get the docs updated on convex components page?
Awesome! Will get the components site redeployed 👍
Cool. Thanks!