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

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....

Unable to Vercel Deploy to Prod with Vite React and Convex Auth

Hi Convex support team! I’ve been building a project with Convex and Vite with Convex Auth (Resend) that is working great locally, but I have been running into issues in trying to deploy to Prod with Vercel. Can someone please help me understand: 1. What are the Vercel environment variables that are needed? Is it just the Convex Prod Deployment Key? Or do I also need to specify the Convex URL eg -donkey-88…? 2. What are the Convex Prod environment variables needed? I currently have the Resend API Key there. Is that correct? Anything else needed eg for my OpenAI calls in my app? ...

Animating database updates

Lets say I want to mutate data , lets say i have a list of items. I want to animate the deletion of an item in the list or animat ethe addition of an item. How would this be done in react? Is there a way to hook into database updates from the client side?...

VSCode keeps showing an error on functional Convex API Call

Hi! My issue is that in my Convex database, I have a table called submissions.ts and the table name in the schema.ts file is also submissions. Thus, when using the API call, I also use api.submissions, which is correct, but VSCode keeps wanting me to switch to api.submission, which is wrong (and if I change to it, the code stops working, which makes sense). How should I address this issue? Is there anything in particular I'm doing wrong with the IDE that is making this an issue? Thank you!...
No description

getUserIdentity returning null + ui errors, convex clerk

Hi, I am trying out Convex + Clerk for first time. I used these docs. https://docs.convex.dev/auth/clerk#user-information-in-functions I am using https.ts in convex with webhook in clerk for sycning users in clerk & convex which seems to be working correctly. ...
No description

Clerk auth v6 integration with Convex provider in Nextjs

So v6 of clerk is out and it gives us the ability to wrap individual components with the clerk provider and pass the dynamic prop to get server side auth. Currently the convex provider requires us to wrap the entire root and wrap that in a dynamic clerk provider causing all pages to be dynamic and rerender on each request… Is there any plans to change how the convex provider works with clerk? It would be nice to take advantage of nextjs ppr and other static rendering methods of pages that don’t require server side auth....
No description

Creating an API Key for Secure Data Access Between Next.js Server and Convex Backend

Hey everyone! 👋 I'm working on a project where I have a Next.js server and a Convex backend. I want my server to access specific data from Convex without needing to set up a user account or similar authentication method on the backend. Ideally, I'd like to create an API key that my Next.js server could use to access this data securely. My Goals:...

npx convex deploy does not send my dev data including files to production

Why does running npx convex deploy not send over my tables from my dev instance and files to the production instance?

Mutation error: `Returned promise will never resolve` caused by triggers

I've never seen this error before, and when i get rid of this trigger in my blocks mutation it goes away... The original mutation contains some promise all statements that insert docs into the blocks table Any ideas?...

Custom function for HTTP action?

I want to use the same authorization process for all HTTP actions in a project rather than including the auth code in each action. I thought a custom action might work, but after reading the Stack post about custom functions, and also reviewing the code in the convex-helpers package, HTTP actions don't appear to be supported. Am I reading that correctly?