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

When I use a paginated query, is there a quick way to know the total count?

I am querying a large dataset, and I have filters based on many fields, some of them are user generated. This means that there is no way to cache the filter result, because there could be an infinite amount of combinations. Right now I need to use
.collect()
.collect()
and count all the documents. Is there a more efficient way of doing this? ...

Upgrading AI SDK to v5 in Convex RAG component

I am trying to do the following in my rag.ts:
export const rag = new RAG(components.rag, {
textEmbeddingModel: google.textEmbeddingModel("gemini-embedding-001"),
embeddingDimension: 2048,
});
export const rag = new RAG(components.rag, {
textEmbeddingModel: google.textEmbeddingModel("gemini-embedding-001"),
embeddingDimension: 2048,
});
...

GIN Indexing in Convex

Hey guys, I really like what you are doing. The issue is that I'm using a lot of changeable, unpredictable JSONB fields in my app, and therefore, I'm kind of chained to the Postgres GIN indexing. Is there any solution in Convex for that need? Cheers...

Clerk, convex, tanstack-start error

TypeError: Cannot read properties of undefined (reading 'config') I am getting this error on my __root.tsx file It looks like the error occurs on beforeLoad function when calling fetchClerkAuth() ...

Query data from TanStack Router loader while using Convex Auth

Hey there! I am wondering if anyone has had success making a query inside a TanStack router loader while using Convex auth. Loaders are executed outside of React, so hooks are a no go. I can’t seem to find docs or figure out a way to use the client directly with auth. Thanks for the help!

JavaScript execution ran out of memory

I have been trying to push changes for about an hour and I keep getting this error. ✖ Error fetching POST https://adorable-gnat-320.convex.cloud/api/push_config 400 Bad Request: InvalidModules: Hit an error while pushing: [0] Loading the pushed modules encountered the following [0] error:...

The competition

Hello just to be sure is it allowed to use open ai api key in this competition?

Billing risk from bad actors

Firstly wanted to say I love what all of you have built so far! This thread was added following discussion in general chat with Ian as per his request. Currently, bad actors can connect via websockets and continue spamming functions. Rate limiters or any other criteria based functions at application layer can prevent access but functions are still called and result in billing. The bad actors will remain connected to the backend and we cant get rid of them. Only mitigation for billing risk at present is spending cap but this would result in downtime for the service. ...

How to model "custom fields" in Convex?

I want to allow the user to define a set of custom fields similar to Asana or Notion Databases. What is the best way to do that in Convex?

convex auth + tanstack query, auth context bug

I'm running into some kind of race condition (maybe related to query hashing?) when combining Convex Auth components with Tanstack Query. The symptom: queries are initially made from client->server without the full auth context, resulting in brief server-side errors The minimum reproduction: ...

Phone OTP auth with Convex auth for expo react native

Hi friends. I am implementing authentication using react native (expo) and convex auth. Everything working perfectly fine except sms sending. I tried to figure out the possible ways however, it seems like the only available option is twilio. is there a way to use other sms provider as my users based in Uzbekistan, twilio is bad option for me. most of the services that availbale in uzbeksitan is uses http API to send OTP. However, i can't send HTTP request inside of convex function. Please help.

Convex custom useAuth with authProvider is really unstable

Does anyone have a react implementation tutorial for useAuth? Its really unstable for me

Local first apps

Has anyone tried using convex for local first apps? how was it, and any recommendations? thanks...

Can't have nested tests / tests in subfolders?

I'm trying to co-locate my tests, and my functions are in various folders. Is it possible to do so? I was running into errors, but it worked when putting them in the root convex/ directory. However, I cannot have the co-location niceness anymore From claude code:
so the issue was we can't have tests in subfolders?
...

Slack App OAuth Install

Has anyone used convex to store installations for Slack apps? https://tools.slack.dev/bolt-js/concepts/authenticating-oauth/ I think I need to register an http endpoint and do it that way somehow?...

Discord oauth with Convex Auth and invalid redirect uri.

Hi! I've been trying to setup discord oauth with convex and it's giving me so much issues! Here's my auth.ts...

How to prevent ddos burning through function calls

right now rate limiter package counts rate limited calls as a function call. how do we prevent malicious actors or bad deployments from flooding function calls and accruing big bill?

Found multiple CONVEX_URL environment variables in .env.local so cannot update automatically.

Getting this warning when I have the following .env.local file: ``` ... CONVEX_URL=https://some-deployment.convex.cloud...
Solution:
It checks from this list, and if it finds multiple it doesn't know which one was set by the cli. Assuming the PUBLIC_ prefix is for your framework, I'd recommend dropping the plain CONVEX_URL and just using that. CONVEX_URL will still be set in the environment for your convex code.
No description

Setting _creationTime during data migration

Hi! I understand that _creationTime is a reserved field that Convex generates automatically when inserting a record. We’re migrating from a MySQL database where we already have a creation_time field. Is it possible to set a custom value for _creationTime during migration, or is there another recommended approach?

Integrating convex with clerk

Hi all, I have been able to setup clerk with convex but I was wondering how can I include the private_metadata field of users in the ctx.auth object :dankSpin:...