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

Recommended way to run migration workflow

I was wondering if the recommended way to deploy to vercel if we add migrations to our migrations.ts file is the following: npx convex deploy --cmd 'turbo run build && npx convex run migrations wanna make sure I get the order right. Also I guess the --prod flag is not necessary if we have the right env variables set in vercel, and that way it'll work for other envs like staging as well ...

Mobile app

Do you plan to create mobile app for team usage, project dashboard? It will be very useful, I guess

Convex runtime does not support SecureRandom

I am trying to create tokens which I can use for auth. Docs say that crypto, CryptoKey, and SubtleCrypto are available. I think I'm only using those APIs, however... The following error is thrown from the dashboard when running my mutation....

Spamming function calls on stream OpenAI responses

Hi, I was looking at the convex-ai-chat repo and found this https://github.com/get-convex/convex-ai-chat/blob/main/convex/serve.ts#L70 ```typescript const stream = await openai.chat.completions.create({ model: OPENAI_MODEL,...

Seems like convex auth isn't setting user immediately

for some reason so if I redirect to a page that checks if there is a valid user if there isn't it redirects me back to sign in so now immediately I redirect to "/dashboard" it redirects me back to "/sign-in" My code for getting currently logged in user ```tsx import { query } from './_generated/server'; import { getAuthUserId } from '@convex-dev/auth/server';...

auth:store signUp Error with duplicate email

I am attempting to handle cases where a user attempts to create an account with an email that already exists in the users table Based on docs it seems I am suppose to use createOrUpdateUser callback in auth.ts My issue is that auth:store is throwing an error before this callback is reached....

`zodToConvex` helper giving unintelligible errors

Not really sure how to proceed from here...

Zod .describe() causing issues with schema validation

I'm seeing the following when running npx convex dev ``` ✖ Error: Unable to run schema validation on https://sensible-salmon-524.convex.cloud [CONVEX] Error fetching POST https://sensible-salmon-524.convex.cloud/api/prepare_schema 400 Bad Request: Error: Hit an error while evaluating your schema: [CONVEX] Uncaught TypeError: Cannot read properties of undefined (reading 'describe')...

Need help with handling Convex Auth signIn errors in prod

I'm using Convex Auth and during dev I'm handling signin errors like this: ``` const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => { e.preventDefault()...

Phone provider with Twilio example is returning an error when executing createAccount() method

Hi there, I am trying to implement the Twilio phone provider example as showed here: https://github.com/get-convex/convex-auth-example/blob/main/convex/otp/TwilioOTP.ts The phone number and later the code (OTP) verification is working without an issue, but when it comes to creating an account I am receiving the following error from Convex: ...

Clerk Webhook for User Creation - is this really suitable?

The docs recommend using a web to store user data from clerk into a Users table in Convex. Not entirely sure this is a suitable method as webhooks are considered brittle, and so if we have to implement a fallback of sorts, should this really be the recommended option for external auth? Perhaps the docs could recommend using the Clerk User object and a mutation (or even better, build a convex-helper function). https://clerk.com/docs/references/javascript/user/user Would like to know your thoughts....

[Convex Auth]: signIn doesn't set isAuthenticated to true immediately

Hi, as the title suggests, signIn doesn't seem to set isAuthenticated immediately after the resolution of its promise. For example, this snippet of our AuthProvider: ``` const { isAuthenticated, isLoading } = useConvexAuth();...

Linking anon users to Google

I have Convex auth set up and would like to do account linkage such that when a user clicks login with Google I can link their account to the current anon user that’s logged in via the callback in auth.ts. I’m having a hard time accessing anon user in there with the same code I use to access it in other places. Anyone know why that might be?

POST /api/auth 404 ???

I am following this: https://github.com/get-convex/convex-auth-example/ and I get this in the console: POST /api/auth 404 in 600ms while clicking the GoogleSignInButton??...

@convex-dev/auth isn't working with NextJs and Github provider

I had some trouble with my main project, so I started a small project with only the simplest login possible and it still won't work. When I follow the instructions in the doc I end up clicking the login button, approving on Github and then my page reloads, with no session created or anything. ```convex/auth.ts import { convexAuth } from "@convex-dev/auth/server"; import Github from "@auth/core/providers/github";...
No description

Cleanest way to handle optional filters

Hello, I need to filter orders table by status /orders route should get all orders /orders?status=pending should get orders with the status of 'pending'...

Dependent queries not working with tanstack query

Convex query is executed even if the enabled condition is not met.
``` const { fetchStatus, data: ordersResponse, isError, isPending: isOrderPending, isSuccess } = useQuery({ ...convexQuery(api.orders.getOrdersByCartIds, { cartDocIds: cartDocIds ?? [], fetchProducts: true }),...

Help consuming an endpoint(for an internalAction) from App.tsx

I'm new to the Convex platform, and while running the sample repository from this article(https://stack.convex.dev/ai-chat-using-langchain-and-convex#ingest-data-loading--splitting--embedding-data) I realized I don't know how to consume the endpoint they created with this line (https://github.com/get-convex/convex-ai-chat-langchain/blob/97610aa58f73ac5abaabdb1e926efceb6ff340f7/convex/ingest/load.ts#L35). I have tried different scripts I found in internet but nothing has worked so far. Can anyone help please? Thanks in advance!!!...

ai API works differently.

I want to create an action that calls openAI API (perplexity in this case). When I use postman I get normal answer based on real life data (like asking about some stock price). When I use fetch from convex server I always get answer that model doesn't have access to the internet. What is wrong here?...
No description

How to wrap the database writer so that `ctx.db.patch` and `ctx.db.insert` run side effects

Firebase has a concept of trigger functions which trigger when documents are created, updated, deleted, etc. I found this really useful since I didn't have to worry about where or how documents were updated to still be sure that a cleanup or side effect would be run. What would be a robust way to do this in Convex? I was trying to do it inside rules but quickly realized that's not possible... This is what my mental model wanted to do:...