Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the open-source reactive database for app developers.

Join

support-community

show-and-tell

general

self-hosted

announcements

Recommended way to handle calls to multiple tables?

Hey! I've got a couple of tables in my project. For one of the tables, I've got a bunch of query and mutation functions. I'd like to use these exact same functions for other tables as well. In a function like this, for example: ```...

do projects get paused on the free plan?

looking for a way to rapidly test ideas and only pay if something takes off. currently using supabase and they automatically pause projects to "save resources". does Convex do this as well?

Possible to Pass Checksum to storage.generateUploadUrl?

Is it possible to pass checksum into the storage.generateUploadUrl function (like snippet below) so that the short-lived URL it generates can only be used to upload the intended file? ``` import { v } from "convex/values"; import { mutation } from "./_generated/server"; ...

IN operator equivalent?

Is there a way to do an IN operation when querying from an array of values? What's the most efficient/recommended way? This is what I am currently doing, but just wondering if there is a better way ```ts...

Bun: `convex dev` doesn't update dev deployment

``` bun convex dev ✔ Provisioned a dev deployment and saved its name as CONVEX_DEPLOYMENT to .env.local Write your Convex functions in convex/...
No description

Server Auth Not Working

I've followed the Convex Auth docs on how to set everything up and have also followed the Debugging Authentication docs. Everything seems to be working correctly to the end of step 3 (I have a valid JWT with "aud", "iss", and "sub" in the payload that matches my Convex site). However, calling the auth functions in my queries/mutations still return null (both in console logs and in the Convex Logs page). ```ts // auth.ts export const getAuth = query({ args: {},...

Implementing confidential computing with Trusted Execution Environments

Hi all! I was wondering if convex had any plans in implementing an easier way to use confidential computing with Trusted Execution Environments. And if not, what your thoughts are on implementing this. I have been quite inspired lately by Kin AI, where there is a incredible emphasis on personal AI and privacy. They use (among other things) on-device storage and Confidential computing. Here is the article: https://mykin.ai/resources/solving-the-holy-grail-of-encryption-in-use I look forward to your response...

setting preview deployments blow up production

setting command npx convex deploy --cmd 'npm run build' in my vercel deployment blow up production because of this error ``` Temporary directory '/tmp' and project directory 'convex/_generated' are on different filesystems. If you're running into errors with other tools watching the project directory, override the temporary directory location with the CONVEX_TMPDIR environment variable. Be sure to pick a temporary directory that's on the same filesystem as your project....

add user manually without registration

Hi all! I'm building a document collection app. The two admins who are going to review the documents should log in via email and password, while the clients who upload the documents can remain unauthenticated. Using Convex Auth, how can I add the two admin accounts without the need for a register page? Through the dashboard for example?...

getting rid of build warning tanstack start

does anyone know how to get rid of these warnings?
No description

AI GATEWAY support

is there a way to use the AI GATEWAY api key for all models instead of having to configure a env variable for each?

Better Auth with MongoDB and Convex for client data

Hi all. I'm not sure if convex is going to work for my use case. I want to make a chat app with Convex storing only the user data (chats and messages), and Better Auth (my auth lib of choice) using MongoDB for user data. This is because I have a very large template that implements most of Better Auth, with SSR-CSR hybrid, some pages requiring the auth object that using Convex with Better Auth replaces with createAuth function requiring context. I want to just fucking list the users chats and m...

How to query for a specific array of documents

Hey everyone, is there a query function that allows me to look for an array of 3 specific items. For example, if I have the IDs of 3 documents, I'd like to get those documents. How would I go about doing this?...

Error on .any() field: "Document is too nested"

Hi. I have an .any() field on an object in my Schema. The documentation doesn't mention any limitations. I have JSON objects which are apparently deeply nested. I'm unable to insert one such object, getting the following error: ... isn't a valid document: Document is too nested (nested 18 levels deep > maximum nesting 16) Must I really re-architecture my JSON document representation to always be inferior or equal to 16 levels, or should I just stringify the JSON and store the document as a string, or something else?...

how to skip in useQueries?

from kappa, "You cannot use "skip" as an argument in useQueries. You must only pass objects for args, and conditionally include queries in the object you pass to useQueries if you want to "skip" them useQueries API." is this true?

tool_calls

Hey so im making a simple agent with a tool that can access rag-search and display that content but im getting an error
[CONVEX A(public/messages:create)] [Request ID: 7ffca58ab010e094] Server Error
Uncaught AI_APICallError: An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_GYArlXZG4Pn4dSe8RNk3ICov
[CONVEX A(public/messages:create)] [Request ID: 7ffca58ab010e094] Server Error
Uncaught AI_APICallError: An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_GYArlXZG4Pn4dSe8RNk3ICov
```...

Action Triggers from Convex Queries

I’m trying to figure out how to trigger an action from a query in Convex. Currently, the only option available is a mutation, which seems limiting. I understand why and I also understand that it's an anti pattern to even want to do it. That said, there are situations where you want to trigger an action when a user fetches data that isn't available. In those cases, you would want to initiate an action to fetch that data from an external service, populate it, and let sync do its thing. The only alternative I can think of is to have the client code manage this. The client would run a query, and if it returns undefined or an empty dataset, it would then trigger a mutation or action to fetch the data. However, I’m concerned about this approach. What if the client code doesn't handle it properly? How can we ensure they do it correctly?...

Lease Lost Error

hey guys, currently doing a azure self hosted of convex. I have a migration script to transfer my docs to convex and even basic convex queries crash my revision in my container Commit failed to write to persistence: Your request couldn't be completed. Try again later.: Lease Lost ... Write failed. Unsure if transaction committed to disk.: Lease Lost...

Issue scheduling an internal action from a helper function

I'm using Convex version 1.26.1. In one file I have an internal action defined like this: ```ts import { internalAction } from "../../_generated/server"; import { v } from "convex/values";...