SDK code generator | SDKgen

1 min read Original article ↗

The real power of SDKgen comes from integrating our code generator into existing workflows. SDKgen allows you to define all API dependencies of your project in a simple sdkgen.json file and automatically generate the appropriate client SDKs. You can think of it like NPM, but instead of packages, it manages external APIs as dependencies.

{
    "type": "client-typescript",
    "require": {
        "fusio/sdk": { <-- TypeHub Specification
            "version": "0.1.0",
            "target": "./src/gen/fusio"
        },
        "https://acme.com/spec/typeapi.json": { <-- Remote HTTP Specification
            "target": "./src/gen/foo"
        },
        "./spec/typeapi.json": { <-- Filesystem Specification
            "target": "./src/gen/bar"
        }
    }
}

After defining the dependencies, you can use one of our integration options (e.g. CLI or Docker) to generate actual code. With the CLI, you simply run:

./sdkgen install

This command downloads every defined dependency and generates the code into the specified target folders.