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

open-source

announcements

Common patterns for migration and data seeding

Hello, i am new to convex and wanted to learn how i can go from development to deploying to production with convex. What are the some common ways you guys perform migrations and data seeding. for example, seeding the admin account details when setting up the application for the first time. or, changing moving out a field from one table to another table after the app has hit production?...

Is this is valid Access-Control-Allow-Origin?

This is my http endpoint return: ```ts return new Response(null, { status: 200,...

[React-Native] Custom Auth - JWT refresh issue

Hello, forwarding the comments on this thread to this new one. Problem: When the app is in background/inactive, the JWT can expire during this period. When the app is put in foreground, it seems that the convex queries are rerun before a new JWT is fetched. A symptom we see is that the ctx.auth.getUserIdentity() function returns null on Convex backend....

union of two types

how do i typeguard in convex? in typescript i usually do type guards to handle this situtation, how to do that in convex? function isText(invoice: args ): invoice is object1 {...

tanstack mutation onError doesnt handle convex error properly

I expect that on the client side, i would just render the message, not the whole error stack
No description

How to handle errors with the `usePaginatedQuery()` React hook?

Greetings, all ๐Ÿ‘‹ I'm brand-new to the discord community, and also in fact somewhat new to Convex (two months, and overall pleased)โ€ฆ So, my question: I'm using usePaginatedQuery() to load realtime chat messages powered by Convex, and am seeking guidance on error handling. I've always got an eye towards error handling which is "extra-strength" when it comes to anything involving network operations ๐Ÿ˜‰ but am finding a lack of any mention in the usePaginatedQuery() docs about error handling of any kind (in fact the only in-page search result for the string "error" highlights the API reference link in the docs nav ๐Ÿ˜… )....

getAuthUserId with tanstack userId null

When using using useQuery from @tanstack/react-query, getAuthUserId always returning null so the current userId is null

How to return a custom list with extra key-value pair(s)?

I am trying to return list from my table "riskAssessments" but with an extra key-value pair on each element to add in the value of a subquery : ```export const listWithVendorNames = query({ handler: async (ctx) => { const assessments = await ctx.db.query("riskAssessments").collect() let assessmentsWithVendorNames = [] ...

Issue with expo app and convex, and how .env variables are loaded

Is there a way to have convex read .env.development rather than the default .env.local The reason for asking is that i am using convex in a expo app where i store some production variables in a .env.production which i use for testing the app against my prod convex deployment. When i run...

Unable to pass Custom Queries to CRUD function.

I logged a ticket with all of the detail in the convex-helpers project, but thought I would share here as well: Ticket: https://github.com/get-convex/convex-helpers/issues/250#issue-2515821771 Issue: I worked on a project over the summer for a client using Convex, and have just started to pick things back up after a few months of low-to-no activity. After updating deps, I seem to have some odd TS error blocking builds & updates....

[ConvexAuth] stuck on auth loading & websocket reconnect

Hello, We are experiencing some issues with the @convex-dev/auth library it seems We are using these versions of the related packages:...

How to apply filter before pagination?

In the provided code, why are filter calls applied first to paginate the documents, and then the Predicate function is applied to those paginated documents? What I need: I want to first search the database, and then apply pagination to the filtered results. How can I modify the code to achieve this? ...

Compound index

Hello everyone, I need some help with Convex database indexing. I have a table named 'skills' and I have two separate indexes on the is_published and is_featured fields. I need to query the data based on both these fields. Initially, I thought of using a compound index, but it seems like the withIndex method doesn't allow multiple .eq() checks. Is there any way to efficiently filter by both these fields using the indexes? Any help would be greatly appreciated!

can't do 2 crons in file ?

I can't do two same crons in one crons.ts ? params are different but i want to run two crons with different params....

how to customize magic link email template?

im planning to use React Email for this but i have no idea where to plug in the code
No description

Incorrect docs for NextJS "Server-side authentication"

The implementation of getAuthToken depends on your authentication provider. app/auth.ts ``` import { auth } from "@clerk/nextjs";...

Convex Auth is not supporting Next.js RC with React 19 right?

I get this error from the @convex-dev/auth library: Attempted import error: 'createContext' is not exported from 'react' ....

Big dataset not in filter

I have asked about this topic before but there are things I can't figure out. I am setting up a structure similar to tinder. I keep the reactions of the users and the user id they reacted to in a table. My flow is working now but it is obvious that it will have problems with large data. (We can think of a scenario where 1 user has 100 thousand reactions and the total number of profiles is 1 million)....