Convex Community

CC

Convex Community

Join the community to ask questions about Convex Community and get answers from other members.

Join

support-community

show-and-tell

general

self-hosted

announcements

callback, 3rd party authentication, convexAuth

I am running into a problem with Figma Oauth 2.0 callback which returns with ?code=&state= appended to the return URL. Now, the ?code part of it is getting consumed by ConvexAuth. I'd love some help on getting around it. I edited my middleware.ts to do the following: ```export default convexAuthNextjsMiddleware((request) => { const url = new URL(request.url)...

libuv assertion with Convex Auth and Node.js 23.10 on Windows

I'm following the Next.js quickstart with npm create convex@latest. Everything was working, including npm run dev, until I followed the Convex Auth setup instructions with npx @convex-dev/auth. Now, npm run dev always fails with: ``` D:\GitHub\mysterious_convex_things>node --version v23.10.0...

push notifications

Hi Everyone, i am interested in implementing push notifications in my web app. I wanna know if and how i can do this using Convex. Also, will it be better to implement this using React Native(I am not yet comfortable with Native)? I would appreciate any links, posts or advice on how to go about this . Thank You 🙏...

Convex Auth Cookie Token in Tanstack Start

I have a Next.js project with Convex and Convex Auth that stores token and refreshToken in cookies. I created a similar project in Tanstack Start with convex and it stores token and refreshToken in localStorage. I am not very familiar with auth and good practices. So is it OK to store token and refreshToken in localStorage. what are the benefits or drawbacks of localStorage tokens? Also is there any way to store token and refreshToken in cookies?...

Route Translation for SDK Autogeneration (kebab-case filenames to camelCase API)

Context: I'm using Convex on several small freelance projects and exploring its integration into larger projects within a corporate environment. The established TypeScript filename convention in this environment is kebab-case (e.g., my-functions.ts). Currently, the SDK autogeneration process creates API routes directly from these filenames, resulting in function access like api["my-functions"].functionFoo. Desired Behavior:...

Paginated indexed query with multiple index choices?

I'm querying a contacts table, and need to retrieve contacts by the region they're in. The table contains a region field (an ID from the regions table) and has an index on that field. When finding contacts matching a single region, both normal and paginated queries using this index are working fine. Yesterday I learned that the app needs to support collecting contacts matching multiple regions. With my normal queries, modifying them to support this requirement was pretty easy. I just ran multiple queries in a loop—one matching each region ID—appending the results of each to an array of type Doc<"contacts">, then returned that array. The snag that I'm hitting is with the paginated query. I can't think of a way to alter it similarly so that its results contain contacts matching all passed region IDs. While I could skip the index and just filter manually, there will eventually be thousands of contacts in this table, so I'd like to find a more optimized solution if at all possible....

Wait for a result

In react what’s the best way to get a result from the convex backend, but not have it be reactive. I want to wait for the result but than I don’t care if it changes

Getting Authorization Code from redirect URI (using Convex Auth w/ Google Provider)

Hello! I am using Convex Auth and have followed the steps to configure the signIn, signOut and other library functions. Now, for my use case, I want to access the Google Calendar API, to which I need the Authorization Code, which I will ultimately use to get an access token. However, I'm having trouble 'intercepting' the redirect so I can extract the authorization code from it. As you see in the image attached, after the user gives consent, it redirects from the Google consent screen to the Convex redirect URI with a code as one of the parameters and then back to our frontend which is at localhost:5173 along with a different 8 digit code that Google doesn't support. How can I go about getting the code in the parameter of the redirect URI? Thank you!...
No description

[Compound indexes]: Query first field, then sort by _creationTime

How can I prune redundant indexes as per the Convex best practices but still leverage that _creationTime is automatically added as the final index field to all indexes ? Wouldn't it be possible to implement something like a q.all that just aggregates/ignores a particular index field? For example: ``` // index definition...

[convex-helpers]: useQueryWithStatus error: "could not find Convex client"

Calling useQueryWithStatus from my frontend causes this error for some reason: Could not find Convex client! useQuery must be used in the React component tree under ConvexProvider. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app I tried defining useQueryWithStatus in a few different locations in my convex folder, all with the same result. Updated to latest convex-helpers version. ...

Convex dashboard timestamp milliseconds

It would be helpful to see milliseconds on timestamp shown. I would assume logs from the one transaction would have the exact same timestamp, helping to quickly see what logs are part of the same transaction when scanning the logs....
No description

Convex Auth Twitter Error

Hey, I set up twitter with convex auth as additional auth for linking the account atm. For primary auth I am using custom ConvexCredentials providers for eth/sol/ton wallet signin which works fine. However after signin with twitter I get the authorize screen but after authorizing it redirects back to previous path because I get the following error in the log at GET /api/auth/callback/twitter ``` 'server responded with an error in the response body at checkOAuthBodyError (../../node_modules/oauth4webapi/src/index.ts:2656:8)...

Clerk + Convex + RN: If using simulators, auth session is shared among devices

I'm using a local environment with 2 or more simulators running my app in Expo Go. If I request a query or mutation from the client, the server with convex seems to recognize every device logged with the same user who connected firstly. So, if I create a document with a mutation from the second connected device logged with different account, I see the new document listed in the UI by the useQuery only in the first logged device in the same network (local). Is there a way to differentiate session among different devices in the same local network?...

TS issue with query argument when calling query from the client

export const getManhwaPageData = query({
args: { manhwaId: v.id("manhwa") },
export const getManhwaPageData = query({
args: { manhwaId: v.id("manhwa") },
...

LocalDeploymentMismatch

I had to logout (to login another account) and now I'm having trouble to login my Convex project through CLI. 1) When try to login without changing device name (previous name) I get this error message: ✖ Error fetching POST https://provision.convex.dev/api/authorize 500 Internal Server Error: InternalServerError: Your request couldn't be completed. Try again later....

can multiple workers safely update different rows in a table concurrently

Hi team – quick question: can multiple workers safely update different rows in a table concurrently? I’m currently seeing table locking issues when multiple workers try to update the different rows of the same table. Would it be better to insert new rows instead of updating an existing one? Is that the more appropriate pattern for handling streaming workloads, rather than trying to maintain a single record per stream?...

Can't start a local deployment

Hey guys, thanks for building an amazing database! I can't start the local deployment: ```...

Implementing push notifications with Convex using Firebase SDK

I know that the Node runtime is only available in actions, but when I try to import the Firebase SDK, I get several errors like this one: ✘ [ERROR] Could not resolve "stream" node_modules/@google-cloud/firestore/build/src/reference/query-util.js:19:25:...

Password provider async callbacks

I have a weird app requirement from a client where they much login using convex auth with the password provider, whilst also logging in to another api that returns an auth token to authenticate requests to another API. My plan was to accept the dual credentials at login, get the auth token, store it in the users table and then use it from there. I am wondering if there is anywhere in the sign flow that allows async fetching of this token and setting it on the user table? As far as i could see there was only an async callback for user creation or update, but that doesnt work when doing credentials. It would also be a benefit to be able to make a call to this external api when the convex auth session is being refreshed, to test if the auth token is still valid, if not i could terminate the convex session at the same time....

Dev deployment is a lot faster than a production one

How come a dev deployment mutations and queries are faster than a production one, in dev it feels like a state update whereas a prod one is noticeably slower. Im using all convex standards in my functions, no ctx.run_, just old plain db interactions