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

self-hosted

announcements

Why I can't get current user's information if I've already logged in

export const viewer = query({ args: {}, handler: async (ctx) => { const userId = await auth.getUserId(ctx); return userId !== null ? ctx.db.get(userId) : null;...

Has anyone else seen this issue? openai api blocking convex?

It seems like this morning any request to the openai api is getting 403 and blocked from cloudflare. Has anyone else seen this? is this maybe an issue downstream on their side?
No description

Optional validator in mutation not working for one attribute but fine for others

I'm not sure what I'm doing wrong on this mutation, I consistently get an error on the logoStorageId when I am calling it when the value is null. None of the other optional validators are giving me grief, just this one : ```export const update = mutation({ args: { id: v.id("vendors"), name: v.optional(v.string()), category: v.optional(v.string()),...

Help!!

I am making use of fetchQuery to get stuff but it’s returning an empty array. What may be wrong because its my first time working with convex. Thanks anyone👍🏾
No description

How can I save additional user information like role "vendor" or "customer" in user table when using

How can I save additional user information like role "vendor" or "customer" in user table when using convex google Auth Google({ profile(res, tokens) { console.info({ res, tokens }); return {...

Clerk auth session in Convex functions

i know i can get user object like this by configuring auth.config.ts
const user = await ctx.auth.getUserIdentity();
const user = await ctx.auth.getUserIdentity();
and in httpActions...

Seeding DB from command line...

The goal is to seed the database (containing a table called "users") with a pre-defined global admin user. Email and password are taken from environment variables. On the local machine, I have a .env.local file. The content of this file is also added to convex project settings in the cloud. Created "seed" internalAction which uses node environment....
No description

convex@latest with vite / convex auth starter kit streamlining

Hey some suggestion for the npm create convex@latest with vite / convex auth starter kit. First of all, looking great, was up with a discord login chat app in a couple minutes and it translates well from next-auth setup. However, I stumbled a bit for the vite SITE_URL and JWT env var setup and had to go back and forth between a couple doc pages. Can we add the generateKeys.mjs script to the starter code in case I picked convex-auth in CLI and maybe even make that script execute the convex env set calls?...

How to redirect to register page from restricted rout if new user

What would be the best way to implement this: I am using Convex AUTH and Nextjs with email otp based authentication using Node mailer. When user submits OTP we verify the OTP and check is the user is existing user or new user using isNewUser query. Based on that I am able to redirect to register page or home page. But there is an edge case I am unable to figure out: if user didn't complete the registration flow and refreshed the page, the user is getting redirected to home page as while submiting the OTP i had already verified the user which gets autheticated. What would be best way to handle this where we restrict the home if user is new user. I tried creating a query function and use it in middleware but it seems that query functions cannot be used in middleware....

Retrieve Total Document Count Before Pagination

I want to retrieve the total number of documents found before pagination takes place. However, I tried the following code and encountered an error. error: Uncaught Error: A query can only be chained once and can't be chained after iteration begins. ...

Deploying with netlify with vite and react.

Hello I am participating on a hackathon and using convex with vite and react. I am having trouble opening my first page when I deploy my app on netlify. When I inspect element it is showing my index.html which has <script type="module" src="src/main.tsx"></script>, but I dont believe it is being executed as I just say on this blank page. When I do npm run dev, it opens the correct page (<Route path="/" element={<LoginSignupPage />} />) not my index.html

Working on hackathon project and getting rate limited

Hi my group at hack the north is currently working on a project where we fetch videos stored in convex. However we are getting rate limited.

Issues with using googleapis on the backend/package not found

I was trying to use googleapis on the convex backend, but ran into an issue that I suspect with has to do with convex, does anyone know how to resolve it?
No description

Error in Server Component

hello there... I'm encountering an error in a server component and I'm unsure about the best approach to resolve it. Could you please provide guidance on how to handle this issue? error: Error: [Request ID: 04418ec216ae34ab] Server Error ArgumentValidationError: Value does not match validator....

Arduino Integration

Is there any way to integrate code from Arduino IDE into convex? Or somehow code to the arduino?

Connecting backend to frontend and facing issues with convex

Hi I am trying to send the request to make it appear on the frontend, but it is not agreeing with convex and we need help debugging.

Having trouble with implementing open ai to AI Chat using OpenAI's Assistants API template

added this to my team's environment however it's not working, OPENAI_API_URL=https://api.openai.com/v1/engines/davinci-codex/completions along with OPENAI_API_KEY...

python-convex db query

How can I query the convex database in Convex? I'd like to grab a row and column from a table with my pk matching, how can I do that in python?

Convex react client requires url

I am getting this error message: Uncaught Error: ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud'. This error shows up when I deploy to Vercel but does not show up on local....

convex-auth template error getAuthUserId

When I install the Convex Auth template https://www.convex.dev/templates/convex-auth with npm create convex -- -t get-convex/convex-auth-example, follow the setup and then do npx convex dev I get the error: ```convex/messages.ts:1:10 - error TS2305: Module '"@convex-dev/auth/server"' has no exported member 'getAuthUserId'. ...