Squirble
CCConvex Community
•Created by Squirble on 12/15/2024 in #support-community
Telegram Authentication
I'm writing a React app with Convex.
I want to support Telegram's super simple Mini App authentication.
Here's how it works:
My telegram bot shares a special link. When a user clicks on the link, it opens a web view to my app, but with some additional information in the fragment identifier of the URL: it passes the telegram user's id, username, first and last name, photo url, a timestamp, and a hash of all that information with the bot's secret.
I've put the bot's secret in my convex environment variables.
I've also written a Convex action that verifies the user information against that secret. This action uses node, so I can't easily re-verify it in every query.
How can I get Convex to see the user as authenticated? Perhaps I need to have my action return a JWT that Convex understands? How do I get the convex client in the web browser to use that JWT in subsequent requests so the user shows up as authenticated in later queries?
117 replies
CCConvex Community
•Created by Squirble on 12/15/2024 in #support-community
How to get `ctx` through indirection?
I'm writing a telegram bot that uses webhooks. I was able to set it up like this:
convex/http.ts
convex/telegramWebhook.ts
Now, in the bot itself, how can I access the convex ctx
?
bot
Can I do some sort of global / thread-local trick to get access to the convex context at a distance? Or do I need to somehow pass it through indirection? Would it be safe to try to attach the convex context to my bot somehow in the webhook http handler? How unique is the convex context? Is it different in each request or is it really just the same thing? Is there a reason we can't just import it from somewhere?10 replies
CCConvex Community
•Created by Squirble on 12/6/2024 in #support-community
React quickstart breaks on `npm run dev:frontend`
I ran
npm create convex@latest
and then npm run dev
but I'm getting an error.
32 replies
CCConvex Community
•Created by Squirble on 12/6/2024 in #support-community
I just finished the tutorial and I have some questions
* Can Convex do local-first? Work offline and sync later?
* Is it possible to run your own convex reactor? (Like github co-location)
* Do companies need to worry about Convex having access to their data?
* This is vendor lock-in, right?
* What happens if you exceed the maximum quotas?
* What happens if Convex raises their prices?
* Can Convex afford to host all this? What if they run out of money?
* How granular are “ready-sets”? Down to the record? Down to the xpath within a record?
* How do queries that use randomness or the date decide when to be updated?
* This “likes” example looks like an N+1 query problem.
* Is it going to cause performance issues or not?
* Will we ultimately want to write it a different way?
* How does its performance compare to postgres?
* This would be a good opportunity to introduce uniqueness constraints so you can’t double-like the same document. Can we do that?
* can the scheduler debounce things?
* Specifically, I’d like to schedule something to occur immediately, but if it is scheduled again within 5 seconds it should wait until the end of that period before executing again, no matter how many times it is called in between.
* access control
* how do you configure which actions/mutations/etc are available on the client side vs the server side?
* how do you configure what’s available to a specific user?
* can I use bun and not use node?
14 replies
CCConvex Community
•Created by Squirble on 12/5/2024 in #support-community
Tutorial doesn't actually work with Node 16
If you do the tutorial steps to start developing with Convex with Node v16.10.0, you'll get an error:
This error can be fixed by upgrading to a newer version of Node. It works fine with v22.12.0.
5 replies