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

Buffered queue race

Objective: Concatenate incoming messages and process them 5 seconds after the last message is received. Solution: Check if a "processing" task is already scheduled. If so, cancel the existing task, concatenate the new message, and reschedule the task. Expectation: Convex should internally handle race conditions in the scheduler, ensuring that no more than one processing task is ever scheduled at a time....

Verifying JWS Signed Payload in Convex httpAction

I am currently working on verifying an Apple App Store notification's signed payload using a public key within a Convex httpAction. Below is a snippet of the code I am using: ```ts import jwt from 'jsonwebtoken'; import { httpAction } from '../_generated/server';...

Help using Convex Action

I'm trying to use an action because I'm calling external SDK and cryptr npm package. But I got an error, I can't find what is wrong. convex/facturapi.ts ```ts...

Convex cache `useQuery` breaks type safety

```tsx import { useQuery } from 'convex/react' import { useQuery as useCachedQuery } from 'convex-helpers/react/cache' const Component = () => {...

Convex-auth with solid or other non-react frameworks

Is there a reccomended way to set up convex-auth for frameworks other than react? I've gotten pretty far with solid js by just calling the signIn/signOut actions from convexAuth() from @convex-dev/auth/server. I can successfully retrieve the auth token but I can't seem to get convex to recognize the user as signed in....

YouTube video watch party design

I have a use case of integrating with the YouTube player iframe API, so that there can be a watch party of multiple users watching the same YouTube video (w/ the video playing at the playing time for all watchers). How would I design a situation like this? What I'm currently thinking is writing the currentPlayingTime to the Convex database every time someone clicks somewhere on the playing bar. Alternatively, I could choose some repeating write logic, e.g. write the current playtime every second or so, but that would cause the video to have a skipping effect since YouTube API can only play to the nearest second....

Are there any examples of best security practices for implementing role-based access control (RBAC)

Are there any examples of best security practices for implementing role-based access control (RBAC) when making requests in a Next.js application using Clerk for authentication and Convex as the backend? Specifically, how should server-side validation be approached?

Problems with the MGMT Example Project (Templates)

I wanted to install the MGMT Example Project from the templates (https://www.convex.dev/templates/fullstack), but when I run "npm run dev" I get the error 'ERROR: "dev:init" exited with 1.'. Does anybody know what that means?...

afterUserCreatedOrUpdated() not being triggered after user creation or update

I have implemented two providers for phone sign-in using these examples: https://github.com/get-convex/convex-auth-example/blob/f699ad3c4c6d3cdcad6b182b9009004c443e53a5/convex/otp/TwilioOTP.ts https://github.com/get-convex/convex-auth-example/blob/5163bd646c208dfce64b3cd4f05109d3c7dbe6f2/convex/otp/TwilioVerify.ts I want to populate the tokenIdentifier field of the user document for later use. I have extended the authTables's users table to have the tokenIdentifier field available....

updating nested object with optional id field

I have scheme like this ``` users:{ nib:v.object({ no:v.string(),...

Can we add custom domain to dev convex deployment?

Currently it seems like we can add custom domain only to prod deployments. Are there any plans to extend that to dev deployments as well?

Help fix the password auth in my sveltekit example

The official auth demo is using react: https://labs.convex.dev/auth/config/passwords I tried that in a new sveltekit app, but got some problems, please help me find out where I'm wrong. layout to init convex filename=src/routes/+layout.svelte: ...

Filter context menu shortcuts not working

For example, if I right click a cell and select filter by > equals "<value>", the filter that's added is "equals null". Even if I select a different option from the context menu, such as greater than, the resulting filter is always "equals null".

How to store tree-like data?

I want to implement something like Git, where you have a tree-structure of revisions. - Every revision has a hash (it's id) - Every revision has a parent revision (null for the root) - Every revision may have children revisions (like branching) ...

Is there a way to use Password + Phone providers for authentication?

I have successfully implemented the Phone provider in my app, but after successful verification of the phone number I would like that a user can define a password for signing in to the app. So it would be a combination of a phone number + password. I know that Password provider can work together with an Email provider (i.e. Resend), which essentially accomplishes what I want to achieve, but it's using an email instead of a phone a channel. Any solution in this regard would be acceptable, so that a user doesn't need to verify an OTP via phone number would be acceptable....

How to obtain cookies in Convex Auth ConvexCredentials authorize?

Hi there, is it somehow possible to get the cookies inside ConvexCredentials authorize? I need to get them to verify the credentials. In NextAuth there is the req parameter in authorize. Your http actions have it as well. ```ts export const { auth, signIn, signOut, store } = convexAuth({ providers: [...

Encrypt organizations secrets

I'm using an external API, where I'm going to create a 1:1 relationship between the organizations in my database and the organizations created in the API. For each request in the external API, I need a secret key per organization for making requests. I need to store in my database the secret key for each organization, but I need to encrypt it. I was thinking of using Cryptr (npm), but reading the Convex documentation, I see that not all npm packages are accepted by convex. Any recommendations would be greatly appreciated....

Simulate Convex Auth Invalid

I've noticed that sometimes when my users leave my site open for a while, their convex auth session becomes invalid. This usually means when a user clicks on a button, the mutation throws an auth error. Is there some standard way to handle this type of issue? It would be nice if there was a way to wrap useMutation or useQuery in custom logic to redirect the user if an auth error gets returned from my api....

Convex Auth Question

Any clue if there is a way to change this oauth screen in google? right now it just shows the convex api url which is a bit off putting for users.
No description

Rejecting signin for unknown users when using magic link authorization (e.g. Resend)

I am using the Resend magic link w/ Convex Auth, which works fine, but I would like to prevent account creation for users that are not already registered in the database. I looked a bit into how Auth.js handles this. They provide a pre-signIn callback that you can use to reject signin attempts. However, this callback isn't exposed via Convex Auth....