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

Convex auth seems to sign me out every 24-28 hours, why?

I cant for the life of me work it out. This is my auth setup: ```ts import { convexAuth } from "@convex-dev/auth/server"; import { Password } from "@convex-dev/auth/providers/Password";...

adding rate limits to existing auth functions (store, viewer ..etc)

I just need advice on how I can implement rate limits for pre-existing function that are coming from convex-auth, Is there a way that I can add a certain callback in my auth.ts? Because it's really important especially for anonymous sign up! Thank you for all the advice folks, I really appreciate it ❤️...

Is this is legit way to upload files? Haven't seen this in any example

With this approach you do not have to create http route. frontend: ```ts function convertFileToBase64(file: File): Promise<string> {...

Error I can't get

Any clue why I'm getting this error. It says it's coming from open api sdk, and I assume it's related to needing 'use node', but the strange thing everything was working fine without needing use node until I refactored the logic into an internalAction and scheduled it from a mutation
No description

Convex dashboard suggestion (DX)

It would be great to have the "Edit Document" view auto subscribe to document updates, so I don't need to re-open the edit document preview window each time I make a change.

Is there a way to get around the Id<"tablename">

Ive been looking in the docs trying to figure this out so that using convex is a lil more type friendly. Situation: Ideally want to keep using the Id<"tablename"> when defining my tables in convex's schema....
No description

how to handle auth errors

Hey I'm trying to show an error to user when auth fails for example when their magic link is expired with auth.js / nextauth I could add error page specified with url param of the error and display it there but how can we handle it with convex auth?...

Hi, I am facing some error in while inserting data into the table created on convex database.

In the frontend, I am taking the user input as a string input for the date input using python. In the schema, I have defined that column to be a v.string() type. Still there is some error while inserting into the table. I am new to javascipt/typescript programming. Can anyone help me with this? Thank you!

Use pdfkit in actions

Hi all, I am trying to create an action to generate pdf and store that in files storage. I am using the pdfkit to generate the pdf. https://github.com/foliojs/pdfkit I ran into error saying it's something wrong with loading the fonts. However, when I try to do this in a node another node backend server, I don't see the same issue. Could somebody give me a hint how should I approach this? ...
No description

convexAuth , nextJS google auth getting 404:not found error while click on the signIn

hey @Michal Srb , i am trying to integrate google auth in convex but it's throwing error of 404 not found Things verified by me : 1. middleware is in root folder 2. Im using alpha version of convex auth...
No description

Typescript error for @tanstack/react-query useMutation

```ts import { api } from "@backend/convex/_generated/api"; import { useMutation } from "@tanstack/react-query"; import { useConvexMutation } from "@convex-dev/react-query"; ...
No description

What's the name of the cookie used by Convex Auth?

I would like to know what name convex auth uses to keep track of session tokens. I like knowing how tools I use work so I can make modifications at any time. By logging into https://labs.convex.dev/auth-example, I noticed that login state works even when there are no cookies, and later found out that Convex auth uses localStorage by default unless when using @convex-dev/auth/nextjs. Anyways, I have something like the ff in localStorage: ```js { theme: "system",...

Convex Auth: a delete user method in useAuthActions (or somewhere)

I'm writing some mutations to also delete records in the auth tables generated by Convex Auth. Would be nice to have a deleteUser method provided by the lib so mutating auth table internals isn't required.

Where does `wrapDatabaseReader` come from?

I'm following this post to create some customer query and mutation handlers and this article makes mention of wrapDatabaseReader and wrapDatabaseWriter but I'm not seeing where those functions are available from?

How to do array filter with multiple values?

I have a user schema with an interests column, which have array to string values, and people can filter based on multiple interest all the selected values will be applied in or relation, but the current "filter" method in convex-helper helps to filter only one value, is there another approach to do it? if I have to change to change my schema that's also fine....

Why not `ctx.db.query("table").withIndex(vectorIndex)`?

This is just out of curiosity, why not ctx.db.query("table").withIndex(vectorIndex) but instead ctx.vectorSearch()? Is it because we don't want to expose ctx.db in actions? In fact, why is there no ctx.db.query() in actions? Is there a reason for not allowing querying dB in actions? Seems to me like it should be fine since unlike mutations, determinism (or non-determinism) of the calling function (an action in this case) doesn't affect anything. Concerning the first question, we can just use Typescript to narrow down the indexes in the withIndex() of queries and mutations to non-vector indexes, while allowing all indexes in actions....

Bad example in docs

In the vector search docs (https://docs.convex.dev/search/vector-search#using-a-separate-table-to-store-vectors), there is the following example: ```ts export const fetchMovies = query({ args: {...

How OIDC with Convex Auth works with HTTP actions endpoints

So when using convex auth, the authorization URL is the convex site URL available via CONVEX_SITE_URL system environment variable. From what I understand, specific endpoints defined by the OpenID spec are expected on such domain/URL (to conform to the spec). Examples of such endpoints are the /token and the /authorize. However, this same CONVEX_SITE_URL is used for HTTP actions, such that if I have an HTTP action at convex/token.ts, then the action is accessible by ${CONVEX_SITE_URL}/token (assuming I have it configured to work that way). Does this not conflict with the /token to be used for auth by convex auth as required by the OpenID spec?...

Running Langfuse for AI tracing inside convex action

The issue I'm having is that I want to run Vercel AI + Langfuse inside a Convex action, so when I visited these docs: https://langfuse.com/docs/integrations/vercel-ai-sdk I leaned towards the Nodejs guide, but that comes with some performance losses on the Convex side (by having to use the use node directive), so ideally I'd use the nextjs guide but I'm not sure how to get that to work with Convex. the founder of Langfuse said:
We have tested the vercel ai sdk integration on vercel (which default to edge functions when using the app router in nextjs afaik) which should be a similar to the cloudflare runtime
...

Passing `ctx` to AI agent tools

I'm currently doing the following inside a convex action: ```ts const result = await createBlockFromPromptAls.run( { ctx: ctx,...