Call convex from a Node.js backend using service authentication
What's the recommended way to use the admin key in the Node.js client? Do I have to pass it as an argument to every query/mutation, or can I set it once when initializing the client to avoid boilerplate?
I also noticed the internal setAdminAuth function. Is that intended for this use case?
I've identified a few potential approaches:
Using convex-better-auth: Generate an admin API key, use it to fetch a session token, and set that token in the Node.js client. (since im already using https://github.com/get-convex/better-auth)
Using Custom JWTs: Configure custom JWT authentication as per the docs, generate a long-lived token for my service, and pass it using setAuth().
Static Key (Less Ideal): Pass the CONVEX_API_KEY as an argument to every individual query/mutation, which seems verbose.

