simonjbest
simonjbest3y ago

convex outside react

Are there any docs on writing to convex outside of React? I want to seed my database with some data via a script.
12 Replies
sujayakar
sujayakar3y ago
hi @simonjbest ! we're still updating the docs, but we have SDKs for both python (https://pypi.org/project/convex/) and JS outside the browser (https://docs.convex.dev/api/classes/browser.ConvexHttpClient). these will then let you call into your queries, mutations, and actions.
PyPI
convex
Python client for the reactive backend-as-a-service Convex.
casado
casado3y ago
@simonjbest let me know if you have any specific questions or need boilerplate. All my Convex use is outside React.
jamwt
jamwt3y ago
@simonjbest here's a quick example in JS from a project of mine: https://github.com/jamwt/roundest-mon-convex/blob/main/scripts/fill-db.ts
GitHub
roundest-mon-convex/fill-db.ts at main · jamwt/roundest-mon-convex
Port of theo.gg's roundest pokemon demo to Convex. Contribute to jamwt/roundest-mon-convex development by creating an account on GitHub.
simonjbest
simonjbestOP3y ago
Thanks, I'll take a look at these and see how I get on 👍
casado
casado3y ago
Here is another one for you that contains a mutation and trigger. You could easily just turn this into a node script.
casado
casado3y ago
GitHub
GitHub - 61cygni/flyconv-pixi: Bare bones convex / pixi / fly configs
Bare bones convex / pixi / fly configs. Contribute to 61cygni/flyconv-pixi development by creating an account on GitHub.
lee
lee3y ago
If you're just looking for seeding data, you could consider the npx convex import command, which copies data into Convex from a json or csv file
nipunn
nipunn3y ago
And yet-another-way, you can edit manually on the dashboard to add a few rows of data by hand (if it's small enough that it's viable).
No description
nipunn
nipunn3y ago
dashboard.convex.dev
simonjbest
simonjbestOP3y ago
Thanks for all the help. I got this working with ConvexHttpClient 🙌
jamwt
jamwt3y ago
fantastic! glad to hear it @simonjbest

Did you find this page helpful?