Convex Polar Organization Token Error
I have set the POLAR_ORGANIZATION_TOKEN in env and in convex dashboard ive tried hard coding the organization token in polar client aswell and i still get the same error. ive tried recreating thew organization token multiple times without success. ive also added all permissions to the organization token aswell with no success
4/23/2025, 6:35:18 PM [CONVEX A(polar:generateCheckoutLink)] Uncaught SDKError: API error occurred: Status 401 Content-Type application/json Body
{"error": "invalid_token", "error_description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."}
at matchFunc (../../node_modules/@polar-sh/sdk/src/lib/matchers.ts:257:12)
at async $do (../../node_modules/@polar-sh/sdk/src/funcs/checkoutsCreate.ts:169:18)
3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
You need the env in convex itself
Place it in the convex dashboard
I made the same mistake, then realized where i went wrong
Could you elaborate more? I'm running into the same issue, and don't understand exaactly what you're saying.
I have the organization access token set in the convex env in the dashboard. It's working fine with my sandbox env in dev, but I'm getting this same checkout error in prod
Got mine working. The fix for me was to create a new enviornment variable in convex
POLAR_SERVER=production