I'm in a similar situation as @niels
I'm in a similar situation as @niels
How would be the syntax to use convex together with a State Management library?
I mean, how can I query the convex database without using hooks (ie. useQuery)?
Couldn't find anything related to that in the doc
9 Replies
Sorry,
I hadn't done my homework correctly. The answer is here: https://docs.convex.dev/client/javascript/node
Node.js | Convex Developer Hub
Convex supports point-in-time queries (see
So this could then be used for Next.js server-side right?
this ConvexHttpClient
Theoretically yes. Although I'm not sure about Authentication
On the "react" side, I'm using Clerk, and having followed the steps in the doc, it works well.
But now I'm not sure how to proceed on how to get a Token outside of react
In your case, on server-side, I guess having something like a "Service Account" or bot user would be great.. but I don't know if it's possible
Kinda a deal breaker.. only client side data fetching natively
Might just go for Drizzle ORM
yep
You can get the auth token from whatever auth provider your using, convex has nothing to do with that. Clerk has functions to pass the auth token to a backend, check the docs
https://clerk.com/docs/references/backend/sessions/get-token#get-token
@patochem
Youc an get the token from clerk and pass it from the client using cookies
getToken() | Clerk
Retrieves a token for a JWT Template that is defined in the Clerk Dashboard.
in the http request
Convex react hooks only make it easy to work with auth, but if you do something custom it can still be done in convex.
Re
only client side data fetching nativelythe client you linked to can be used anywhere and has a
setAuth()
method for the JWT. It just becomes your job to send in this JWT to the server you're using the client on.