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

Security policies blocking internal users?

We login as a lot of users to help them debug issues or take action on their behalf We noticed some queries tied to Convex don't load when we do this, making it seem like our website is broken. However, on different devices (where we login as multiple users less often), we don't see this issue. Is convex applying security policies to our internal accounts? Any way we can turn these off for us so we don't panic that something in prod has broken?...

Why I can't get current logged in user information

When I logged in using convex auth, auth and user tables updated, but can't get current authenticated user like this way const identity = await ctx.auth.getUserIdentity(); Also got this error...
No description

External API fetch advise

Hello, I'm using Convex folder for all my data-access layer now. I need to fetch some data from other APIs and they don't interact with Convex. I'm using Next.js. Is there any downside if I use an action in a 'use node' file for fetching data, or is better to use a next.js route instead?

Getting orgId from userIdentity does not work

I can't seem to apply my org ID to newly created resources. I'm not sure what I'm doing wrong : ```export const add = mutation({ args: { orgId: v.optional(v.string()), name: v.string(), category: v.string(),...

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.