JulesJ
Convex Community6mo ago
11 replies
Jules

Running internal functions from a tooling script

Hi, I would like to create a development tooling script that can invoke specific queries/mutations on our production deployment. Ideally we make these internal functions so they can't be called from web clients. I know that it's possible to call internal functions through npx convex run or from the Convex dashboard, and I'm interested to know if there is a SDK that we can use to do this from a script.

I tried creating a SDK wrapper myself which uses npx convex run under the hood, which does work on small queries, but I'm running into issues with JSON serialisation and shell buffer size limits.

What kind of implementation do you suggest to achieve querying a production deployment from a development script reliably? Also open for other suggestions, e.g. creating public functions with argument-based token authentication, but I am curious to learn what the suggested best practice is.
Was this page helpful?