How to offer external API usage?
Hello,
I have been thinking the last couple of days where to start for offering access to my app externally using API.
The app is using Clerk for authentication, and I only want them to gain access to their own workspace.
Is it possible to generate API keys, possible something that I could offer in-app, and then they could use that for authentication.
Do we have any documentation for this?
5 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!
Are you planning on using http actions for api access?
Either way, the built in authentication method for Convex functions is id tokens, which are short lived by nature. You could generate api keys, store them, and validate function calls yourself. I don't know of any prior art though in terms of docs or tutorials.
@erquhart Thanks! I think it could be cool with http actions, and most see what I do. I will do a sample app when I get it to work 🙂
I also need to support API keys for my users making requests. I've decided after learning about this in detail that it's best to used a managed KMS like AWS KMS or Google Cloud KMS.
Doing it yourself is surprisingly easy but there's a reason people don't do this 😂
I'm wishing that Clerk did this...
speaking of http api, i thought hono was what people typically used. I want to make something that just turns my most of my convex functions into http ones.