Typed node client

Do you think it'd be possible to create a typed version of the node js client?
5 Replies
Michal Srb
Michal Srb2y ago
Hey @Chad Maycumber , can you elaborate on what you mean by typed version of the node js client? You can use TypeScript to write Node.js scripts and use ConvexHttpClient which is fully typed and supports TypeScript as does all of our JS API.
Chad Maycumber
Chad MaycumberOP2y ago
Ahh for some reason I thought leveraging the ConvexHTTPClient wasn't typed. Maybe I'm doing something wrong
ballingt
ballingt2y ago
You'll want to pass your generated API into the constructor as a type parameter.
const convex = new ConvexHttpClient<API>(address);
const convex = new ConvexHttpClient<API>(address);
Chad Maycumber
Chad MaycumberOP2y ago
Oh amazing thanks appreciate that
ballingt
ballingt2y ago
which is imported from ../convex/_generated/api

Did you find this page helpful?