Code Generation
Last updated
Was this helpful?
Last updated
Was this helpful?
We provide an OpenAPI Spec that represents a formal specification of our API Interface. A powerful side effect of OpenAPI is that you can perform code generation to generate your own (often strongly-typed) library to work with it.
We'll show you how to do it with TypeScript here, but solutions exist for most languages out there. OpenAPI is very well support across most languages - see for a starting point for virtually every language.
is a popular solution for generating a TypeScript client in order to interface with our API in a programmatic, type-safe way.
First, install the library into your project as a dev dependency.
Then, add a script to your package.json
scripts
tag that will perform code generation from our specification.
When run with npm run generate:akkio
, this will generate a strongly typed client through which you can easily make type-safe queries.