Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the fullstack TypeScript platform for developers and startup founders.

Join

support-community

show-and-tell

general

self-hosted

announcements

Cannot access the "page" return type for pagination

I am working with the pagination function provided by convex and I was trying to make a messaging feature for the application I am working on but I cannot access the "page" return type for my application. I get the toString and toLocaleString options instead. How can i make it work?...
No description

Dev to prod table export/import

Hi, My goal is to create deployment version and port all of the data from dev tables to prod. I have done the following to
- npx convex deploy to create deployment branch in convex - exported backup as ZIP from dev branch...

Does Vercel charge bandwidth for Convex images?

My team’s building a messaging aspect to our Next.js app and this question came up: We’re pretty confident that Vercel bandwidth is charged for images in the /next directory. These are images distributed throughout the Vercel CDN. But do images in convex (file storage) get charged for Vercel bandwidth when displayed on the front end?...

Hosting in EU

Are the re any options to currently (or as a roadmap feature planned) enable data residency i.e. hosting inside a specific region i.e. EU?

Creating a new authAccount not with signIn of useAuthActions

Hey, I’m building a site with Nextjs and using convex. I want the admin of the site to be able to create the users (doesn’t matter the provider but either password, otp or resend). I managed to add new user but not in the authAccount table which is what I need for them to login by themselves after the admin of the site adds them. Thank you!...

GetUserIdentity null

Hi there, I have a list of queries that run for it's corresponding page in my nextjs 14 web app. Inside each query I have a getUser hook that will check the identity and return the user associated with it: ``` import { QueryCtx } from "@/convex/_generated/server"; ...

NextJS 15 Dynamic API Async Errors

Hello, I'm currently receiving this error when trying to use NextJS15 with Convex and Convex Auth [Error: Route "/signin" used headers().get('Host'). headers() should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis]...

How to handle the elapse of time for debounce logic in Convex?

I’m building the notification logic for direct messaging. My app is prelaunch, and I want to keep the notification logic simple for the MVP. For now, the logic should be based on data that's simple to gather, e.g. debounce time and read receipts. In the future, we may add more factors for the logic, e.g. user presence. And more notification types, e.g. native in-app notifications. The key challenge I’m facing in Convex is managing time-based logic to debounce email notifications. Ideally, the app delays notifications for a short period in order to group multiple messages into a single email. Below are my current potential approaches for debouncing. Which do you recommend?...

ShadCN Table Example with Convex Pagination/Filtering/Sorting

Does anyone have an example or can point me in the right direction of using a ShadCN table using a Convex pagination query with filtering, sorting and ordering, etc... i.e. not client side pagination/filtering/sorting using collect because I have hit the 8MiB limit so I cannot get all the records upfront unfortunately. Thanks in advance.

custom password provider

hello, does anyone know how to make a custom password provider using convex auth? just some basic stuff like using username instead of email, adding the possibility to change the password...

Guidance on properly cascading deletions

I'm working on converting the Ents SaaS Next.js Starter ( https://www.convex.dev/templates/ents-saas-starter ) away from Ents, because other than Ents it has everything I wanted. To do this I was reading about Ents, and came across this article talking about the challenges of deletion: https://stack.convex.dev/ents#cascading-deletes-soft-deletion-and-scheduled-deletion . It says:
This makes deletion in general more challenging though. You can easily have a scenario where a document’s ID is stored in 1000s or even more other documents. Deleting all of these documents in a single mutation, which is within a single transaction, is simply impossible, as it would require a long-lived transaction, grinding the whole database to a halt (something Convex does not allow, instead failing the mutation).
So in conventional Convex, what's the suggested way to cascade a delete? I would prefer my app to not fail at deleting a workspace only when it has a lot of content in it....

Running Convex locally while deploying to hosted plan

I'm building an open source project on top of Convex and I'd like to accept code contributions from others. Afaik the only way to enable this right now is to add every contributor as a paid seat on my Convex plan, and although I wish I had the project income to do that, we currently make $0 in revenue. Is it possible to enable people to spin up a local backend for Convex while still relying on the hosted/paid plan for production data and management?

Stable pagination

I am building an application and I need to add pagination to my tables but at the same time I don't want to have loading blinks when I apply filter. I followed this guide: "Help, my app is overreacting!". First when I added the stable it worked fine, but when I implemented the pagination it broke. I don't know what could be causing the problem. Has anyone have a similar problem?

How does the convex dashboard animate data change?

When we update the document in convex dashboard, the dashboard is able to animate the changed cell. and this works across all clients. How is it able to detect a data change (assuming the dashboard uses convex as the backend)

Notification System Design Advice

I'm developing a notification system for a prelaunch startup and would like some advice on how to implement this using Convex. After some research, I've noticed that most companies have a complex microservice architecture for this task. They implement many different types of notifications (SMS, Push, Email, etc.) using event-driven architecture. Popular technologies such as Apache Kafka and RabbitMQ are used for message events. I have attached a diagram of my system design draft v1 for direct messages using email notifications. My goal is to make a notification system that relies on outside services as little as possible and utilizes Convex to the fullest. I'm also thinking of expanding this system and supporting multiple different types of notifications as the needs of the product grow. If you have any advice that would be greatly appreciated....
No description

getUserIdentity returns null in Expo Clerk (Android)

I have a react native expo application and I use convex with clerk for authentication. The getUserIdentity is returning null when called in a server function. This behaviour occurs only when the client is android. This behaviour does not occur with an IOS device (iphone). This is how I make the call in a server function: ```...

"Connection lost while action was in flight" Error

Hi all, I'm having an issue with handling large API responses in Convex. The endpoint returns responses up to 150MB in size. The request works fine via curl, but fails when i run the action from the Convex console with: "Connection lost while action was in flight" Would appreciate any guidance on best practices for handling large API responses in Convex, or alternative approaches. Thanks...

Too many bytes read in a single function execution in migration

Hi, I am trying to run a migration on a table. When docs come in in the migrateOne function, i get the above error. How can I possibly deal with my docs if I can't load a single doc in a query?

Looping over tables with normalizeId?

I've looked all over at posted examples of normalizeId and all related posts and i can't figure out if there is any other way to get a proper runtime tableName that isn't saved in the db. Is there any real downside to this, no performance hit right? When looping through say 10 tables for the one that might have the id. I'd like to be clear what all the options are. I know ents doesn't have ctx.db.get(id) but i havent seen that done either. ...

Multiple monorepo app deployments using the same convex backend?

What is the general consensus about this in production? If its doable then what are the possible downsides? Assuming we have several apps deployed all using the same backend, i'm worried if one deploy fails while the other builds and updates the database the version mismatch. We do plan to track code versions and db versions eventually anyway which could have safeguards....