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

"Could not decode token" custom JWT auth

While following the custom auth configuration setup, I ran into this issue where the backend could not decode the access token Here is my auth setup ``` export default {...
No description

How to Get File Size in onUpload with Convex R2 When getMetadata Returns Null?

Hi everyone, I'm working with Convex and the R2 component for file uploads. My goal is to get the size of the uploaded file immediately after the upload completes, specifically within the onUpload callback, so I can track storage usage per user. The issue I'm encountering is that when I call r2.getMetadata(ctx, key) inside the onUpload function, it returns null. I suspect this is because onUpload might be running as part of the syncMetadata process, and the metadata isn't fully available or settled at that exact moment through r2.getMetadata....

Caching Expensive Database Query

Hi All, I've been playing around trying to come to terms with Convex, its been a nice experience so far but I'm looking for some advice as I've tried finding the answer myself and am just going round in circles 😅. Essentially I have a database query that computes a very expensive operation due having to calculate time series and format it in a way that can be used....

Offline support feedback/request

Continuation off https://discord.com/channels/1019350475847499849/1374547016700395620/1377011133617016852 for realtime we are currently migrating from a yanky YJS setup that we use for a chat. the pro is is its simple, simple to add data and offline is simple. conns are hard to know what data there is what state that it is in. adding things like notification for @mentions is hard. its generaly just bad as you can imagine. @ian...

Securely Calling Google Cloud (Vertex AI) from Convex via Workload Identity Federation

Hiya, another vibe coder here. A friend and I (neither developers) have just been on a marathon journey to get what we thought would be a simple integration working: calling the Google Cloud Vertex AI (Gemini) API from a Convex action, but using Workload Identity Federation (WIF) to avoid service account keys. We got it working in the end, but the path was complex! We wanted to share our final, working solution and also ask the community and the Convex team: is this the best way, or did we miss a simpler, built-in method? (after all the work, I kinda hope our way is the only way) We wanted to call a GCP API from a Convex action using a token generated by a GitHub Action, with no secret keys checked into source control or stored in environment variables....

An efficient way to architecht a YouTube like comments section in DB

Quick explanation of the comments‑section bottleneck I’m rewriting our prototype (React + json‑server) in Next.js with Convex and hit a data‑model problem around threaded comments. Current model...

Vector Search with relational filter

Given this schema, how do I only retrieve embeddings for notes that belong to this particular user? Do I need to put the userId into the embedding table as well? ```typescript...

Migrating to a minimal `biome.json`

Do you really need all this mess in eslint.config.js? It's what Chef defaults to. When migrating this config to Biome, it generates a config of 600 lines.
No description

Convex is slow

I'm using the Convex backend and when loading products on a page, it's slow. Even for just 7 products. How acn I improve it?

The Amazon CloudFront distribution is configured to block access from your country

I'm calling 3rd party api from convex backend and getting this message from that api: "The Amazon CloudFront distribution is configured to block access from your country" Same happened to me when I was trying to call binance api. Is there a workaround?...

Is there an easy way to download all of your docs as markdown files for AI?

The idea is that I want to feed all of your docs into context for Claude Code to have access to. If there's a better way to do this, i'd like to know that as well. Thanks!...

First time setup runs each time I run `dev` from a convex chef project

Is this expected? It's kind of annoying having to go through these prompts each time I call bun dev, haven't modified the dev script at all
No description

Cursor MCP-server ENOENT error on Windows - please HELP

I assume this is a problem with Cursor on Windows and not Convex MCP server as it looks connected. I tried all workaround on web but nothing sorted this issue. Despite I am starting Cursor from the right project directory, it keeps telling me it cannot locate package.json: {"error":"Unable to read your package.json: Error: ENOENT: no such file or directory, open 'C:\Users\petr\AppData\Local\Programs\cursor\package.json'. Make sure you're running this command from the root directory of a Convex app that contains the package.json"} I have W11, Cursor 0.50.7 and following mcp.json:...
No description

Can I fetch then render/navigate?

iOS uses this pattern a lot I click an item, it shows a spinner in the item, then I can navigate once it’s been loaded (see video) If I fetch data one off with convex.query, will useQuery have that data preloaded on the next page upon navigating to it?...

MCPs refuses to connect

this is making me go crazy, the server is clearly connecting on the backend yet this somehow fails, and no detailed error? what does not connected mean 😭 i even have eventsouce, eventsource extended installed also tried streamable http i also have "use node" on the top n everything, please liberate me. I couldn't sleep the entire night....
No description

Help with RevenueCat webhook

Hello, I was trying to setup Convex with RevenueCat webhook. Mostly the logic works fine but it breaks after I fetched subscriber information from RevenueCat and tried to parse json from response. It seems like RevenueCat includes field with key $attConsentStatus and Convex doesnt like it because we are getting validator error: ``` Uncaught Error: Field name $attConsentStatus starts with a '$', which is reserved. at validateObjectField (../../node_modules/convex/src/values/value.ts:162:2) at convexToJsonInternal (../../node_modules/convex/src/values/value.ts:349:6)...

Using an existing convex backend/full stack app with expo app

Hello people, I've recently started using convex for my pet project and I am stuck on something trivial I'm making a food delivery app. I'm using convex auth for authentication. I used this authentication successfully on react based admin panel which is working as expected everytime. I'm now using this on expo but I'm running into some issues I've attached a few screenshots of the code and package.json. I'm using exactly the same thing on the admin panel side)...
No description

Optimistic Update conflict

I'm working on a 'favorites' feature for products, where you can like or unlike an item. When you like something, it shows up as liked right away on your screen because I save it locally. If you unlike it, it disappears from your local favorites immediately. The tricky part is when you quickly like and then unlike an item. Your screen shows it as unliked, which is correct. But, the 'like' action is still being processed by the server. If the server confirms the 'like' after you've already unliked it, the item flashes as 'liked' for a moment before going back to 'unliked'. It's a bit of a visual glitch. Is there a good way to stop this from happening and make sure the screen always shows what you actually last did, even if the server is a bit slow to catch up?...

Getting "No auth provider found matching the given token" with Convex Password Auth

I'm running basic Svelte Kit + Convex Dev locally, I have configured environment variables in my convex dev deployment and I'm even getting what seems to be a valid JWT token out of signIn action Since I'm not using Next and Svelte doesn't have a more automatic token store/retrieve/refresh mechanism yet, I set up the fetchTokens function as instructed in the site (and even though it isn't as automatic, it still seems pretty straightforward to configure, props for gud API design); However, with all that when the API calls it's Authenticate passing the token I got from login, I get a "No auth provider found matching the given token" error and then the websocket literally dies and stops retrying and the refresh token api call never resolves or rejects Anyone have any light to shed?...
No description

Deploying Convex in a Turborepo

I've been following along the guide to deploy Convex to Vercel. Owing to the fact that my repository is a turborepo, I'm finding the deployment instructions a bit confusing. I used Better T-Stack to create my repository. This means that the Convex directory is structured as such: ``` todo/ ├── apps...