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

Accessing client IP address in a query/mutation

Good day. Any help would be appreciated, as I am fairly new to Convex. Is there a way to expose HTTP headers, such as for obtaining the IP address in the example below? Or is an httpAction required for this use case? ```TypeScript const registerClient = mutation({ args: { userAgent: v.string() },...

local dev environment?

Hello. I've been using Firebase for years and one of the things I love most about it is the local emulator suite which also has a local GUI you can launch in a browser. Is there any equivalent to that with Convex? I just learned about Convex and am curious to give it a try.

Database Structure Help

Hey I need a little help trying to structure my database. I'm making a tenant management app. There are multiple managers and each manager can create multiple properties and add one tenant per property. There is a page that allows the manager to view all his tenants but for that to work I need to get all their properties and then get all the tenants under each property It feels really tedieous and I was wondering if there is a smarter more proper way to do this I feel like the tenant should also have a manager_id field but I don't know if that's how it should be done...

convex.cloud requests blocked by malwarebytes

I just had a usertest session of my app and the user reported that links to my convex.cloud deployment were blocked by malwarebytes so we couldn't do any testing. Has this happened before? Do we have any idea what could cause this?

Getting the user id

I am following a tutorial where they use
const userId = await auth.getUserId(ctx)
const userId = await auth.getUserId(ctx)
This is apprently deprecated now, so looking at the Convex code nase in my IDE I see I have to use
const userId = await getAuthUserId(ctx);
const userId = await getAuthUserId(ctx);
...

What to put for auth.config.ts domain?

If the url for the jwks.json is https://auth.privy.io/api/v1/apps/<app_id>/jwks.json, what should be the value of domain in auth.config.ts?

debouncing

hey! i have a text input and based on its value i need to query the database? right now as soon as i type something it starts to query and is being super reactive. which is good, but at the same time "isn't it putting too much pressure on db"? and hence increasing the total costs for me? should i implement a debouncing on the client side for that? if yes -- then whats is the best way to do that? because its returning immediately results for previous debounced value -- which is wrong and staying like that for some time until the next debounced value appears...

About receiving useQuery events

I have a question about useQuery. (This is a translation, so the wording may be awkward). I'm developing a chat room. I'll give you an example to help you understand. I've created the following getMessages function to query messages per chat room. export const getMessages = query({...

Convex Auth + Google + Custom Domain

Hey Convex team, I've configured Convex Auth with Google and it works great, except my Convex .site domain is being used even though I have a custom HTTP Actions domain configured in both Convex and Google Auth Platform. The Convex URL shows up in the Google sign-in page, which makes it look untrustworthy to my customer (see screenshot) -- I need this page to display my custom subdomain instead. I tried editing the domain value in my auth.config.ts, but this doesn't help -- it seems process.env.CONVEX_SITE_URL is hardcoded in several places....
No description

Clerk integration call functions infinitely - need help

Using expo@52.0.17, convex@1.17.3 and @clerk/clerk-expo@2.4.2, currently working in a turborepo project with yarn I have configured the clerk integration according to the documentation, my _layout.tsx : ```typescript import { ClerkProvider, useAuth, ClerkLoaded } from "@clerk/clerk-expo"; import { ConvexProviderWithClerk } from "convex/react-clerk";...
No description

convex.json schema?

Hey there, I was wondering if there was a JSON schema available for the convex.json config file by chance. Does this exist? Couldn't find anything on the Convex search.

I currently run a cron job every 20 sec but its using bandwidth a lot how can i reduce the bandwidth

My cron job currently runs every 20 sec. It scrapes data from a site and inserts into the db. The db has 300 rows and 12 columns which is updated every 20 sec. My ideal situation is to be able to run the cron every 10 sec or even lower but seeing that i am doing something clearly wrong how can i optimise this behavior. I liked using convex because of the real time changes that can be seen in the UI when i change the db data after cron job updates it. Any help is appreciated.
No description

.paginate combined with .withIndex is causing an error

let say I have two tables in my scheme that represents a user that lives in a city and posts that are made in a city. All the code below could be better arranged, but this is for the simplicity of the example: ```TS const userTable = defineTable({...

Convex Auth + Tamagui (Monorepo)

Hey, I added convex to my nextjs app so far, but trying to use Auth signIn Im getting http://localhost:3000/api/auth 404 Not found error. What am I doing wrong?
No description

Convex with Vue/Nuxt

Hi everyone! Has anyone here used Convex with Vue.js or Nuxt.js? If so, I’d love to hear about your experiences and best practices! Also, is there any official support for Vue.js coming from Convex, similar to the @convex-dev/react library for React? Or any guidance on how to best leverage Convex’s features in Vue apps, especially for managing real-time updates?...

Telegram Authentication

I'm writing a React app with Convex. I want to support Telegram's super simple Mini App authentication. Here's how it works:...

how do you do a like operator in queries?

Just started using Convex and I'm trying to find out how to do a simple like operator in a query.

How to get `ctx` through indirection?

I'm writing a telegram bot that uses webhooks. I was able to set it up like this: convex/http.ts ```typescript import { httpRouter } from "convex/server";...

Help with search in join table

Hi, I've been looking for an answer for this with no success. I have 3 tables, users, workspaces and members. members is a join table, each member has a userId and a workspaceId. Every workspace has also an ownerId. I want to be able to search (text search withSearchIndex) workspaces where the user is a member of without being the owner. I'm using aggregate for performance reasons and i need pagination. Here is how we would write it in SQL code to be more clear. ```SELECT w.*...