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

Type error when NOT directly calling function (new to Convex 1.18.2)

I see in the update notes, it's not a good practice to call a function directly from another function. However, when rectifying this (e.g. using ctx.runQuery(myApiQuery) vs myApiQuery() I'm getting the stubborn "Function implicitly has return type 'any' because..." error. Any idea why this is now upsetting the type system? ...

Can't build source using a mac

mac 15.2 node 18.10 npm: 8.19.2 latest rust latest pnpm...

Query arguments issue?

Came across an interesting problem that I was hoping to get some help with. Basically I have a query that receives a timestamp as an argument to control what information is returned. This argument will change in certain key situations. I know the default Convex behavior is to create a new subscription for each set of arguments, but I don't want all these subscriptions active because those will consume too much data. Is there a way to close unwanted subscriptions?...

Debug Internal Node Errors

I tried to setup Assembly AI with their SDK, but I got this error. Running this code from a conex action causes this error, I do not know how to debug this or what the actual error message might be. I have 'use node' directive at the top of the action file Are there plans to make debugging internal node errors like this easieer? Can I get help with what went wrong...
No description

How do I search for a value in a table that is related to another table in relationship?

So I have a table called messages and another table called messages members, I'm trying to search for messages that are equal to the search query but at the same time the user is part of? I've tried creating a paginated query: ```ts const channelsWithUser = await ctx.db.query("members")...

[Convex Auth] Clerk Integration with Convex

Clerk will automatically create a convex user for social sign ups but the same flow doesn't work for email sign ups. Convex user is not being created automatically for Email sign up flow while it works correctly for social signup and sign in. The following is the code for email password registration. ``` const [email, setEmail] = useState("");...

[Convex Auth] How to access param in `createOrUpdateUser` callback

Hello, I’m working on a system similar to AWS IAM, where a root user can create sub-users. The sub-users can log in using a combination of the root user’s ID, their own email, and password. Currently, I have two tables: one for root users and another for sub-users. While I can customize user creation and updates by implementing my own createOrUpdateUser callback, I’m facing a challenge. There’s no way to access supplementary data, such as the root user ID, during the login process. This makes it difficult to allow sub-users to authenticate using the required root user ID + sub-user email + password combination. Any workaround?...

Convex on my lambda

I need to ingest some data to convex. how do I authenticate convex on a lambda instance? Also would I use mutation with the client from convex/browser? ```js import { ConvexClient } from 'convex/browser' const client = new ConvexClient(CONVEX_URL)...

how do add authentication providers to production settings in Convex

I deployed my dev app, including convex functions into prod. The app uses convex-auth for authentication. In looking at the Convex Dashboard settings, I see that I don't have any settings for my authentication configuration. How can I set this up?

SOLVED: User error (Was: Strange PROD behavior with validation)

I am seeing some strange behavior in my prod environment: ``` Jan 18, 22:46:30 failure ...
No description

query optimization & recommendation please

I’m using Convex for a project and need some advice on optimizing queries, especially for dashboard metrics. Currently, I have to query the entire dataset before performing operations, which could become inefficient as the dataset grows. Could you recommend strategies or best practices for improving query performance, particularly when calculating dashboard metrics? Additionally, any insights on structuring schemas and defining indexes for large datasets would be appreciated. ```...

Convex Auth with Expo and Native Apple and Google Sign In

Hello, I am currently following the documentation for using Convex Auth with Expo. However, the documentation provides an example to sign up with the in app web-browser when used with Apple or Google Sign In. Although I get why it's done that way, as Convex Auth is in an early stage and still in beta, but displaying a webview to sign in with Apple/Google in an app is not the perfect experience for users. I would like to use Convex Auth but with expo-apple-authentication and @react-native-google-signin/google-signin that allows to provide native experience sign-in. ...

getting type of query

+page.svelte
const accounts = useQuery(api.accounts.list, {});
const accounts = useQuery(api.accounts.list, {});
component...

How to migrate personal deployment to another Convex team and project?

In my Convex plan, I have reached my seat max for teammates in my Convex team. We have a project with this max count of developers. My company just brought in a new colleague. If I remove a pre-existing teammate, Alice, from my Convex team, and then add Bob, the new colleague, to the Convex team, then what happens to Alice's non-production deployment? ...

Retrieve Authenticate User ConvexAuth

I got some issue to retrieve the logged In user. or when I console.log(isAuthenticated) I got true
No description

convex auth nextjs middleware removes "code" query param. Conflicts with third party oauth integrati

Convex auth nextjs middleware removes the "code" query param by default which conflicts with third party integration. In my case, calendly. Their oauth 2 process returns a code param appended to my redirect uri but the convex nextjs middleware delete it and therefore I can't complete flow. Is there a way to prefix this with convex (convexCode) instead? Or another solution to avoid conflicts?...

Convex Auth workflow

I'm converting from Remix/ReactRouter7 and Supabase to TanStack Start and Convex. I have this working in the other app and I'm having trouble knowing what to put where in "TanVex" or "ConStack" 🙂 Step 1 - User puts their email in a form for a Magic Link auth (which I have working on its own), and clicks the button. Step 2 - I need convex to take the submitted email address, query my "people" table and check if (a) the email exists/is connected to a user and (b) the "can_login" boolean for the user is set to true. Here is how I'm capturing the email address and sending it to the query:...

Is it possible to listen for subscribe/unsubscribe events for queries and trigger an action?

For example, for a convex query like api.messages.list, I want to be able to query the users who are listening to it at that time. I can update the lastOnline value for each user periodically and track it with this, but this will cause an absurd number of function calls. Since the client connects to the backend via websocket, this information is actually available in the backend. But I couldn't find how to access it and trigger an action in case of disconnect.

Type Mismatch in Update Mutation with Optional Fields

I’m running into a type mismatch issue when updating an account using a mutation. Simplified version of my setup: schema.ts ```ts export const account = v.object({ name: v.string(),...

DELETE_MISSING_KEY error on aggregate.trigger() on trigger (convex helper)

im trying to create a count aggregations on an existing table. i manage to run the migration as per below ```ts export const backfillAggregatesMigration = migrations.define({...
No description