Skip to main content
Config as Code has two front doors to the same system. Write your resources as YAML files, or build them in TypeScript with the define* helpers in the Node SDK (at the subpath @roarkanalytics/sdk/lib/config). Both produce the identical bundle and go through the identical diff / apply, so you can pick whichever fits your codebase, or mix them. TypeScript buys you type-checked fields, editor autocomplete on every resource, typed cross-references (reference an agent by its construct, not a string), loops and shared constants, and prompts as plain strings, with no YAML file:// sentinel. The Quickstart walks the full author-preview-apply loop in both languages, and every resource page below carries a TypeScript example beside its YAML.

Builders

One define* helper per resource kind. Each injects the resource’s kind (and any fixed discriminator) and returns the exact object config.apply expects: defineConfig({ resources, prune }) assembles the bundle. resources accepts both builder outputs and raw resource objects, so a kind without a dedicated helper still fits:

Apply semantics

Identical to the YAML path, because the output is the same bundle: identity by name, cross-references resolved by name, prune deletes config-managed resources you drop (set prune: false for additive-only), and applies are idempotent. See Apply semantics for the full rules, and Config-managed resources in the UI for how managed resources behave in the dashboard.
YAML and TypeScript are interchangeable, not exclusive. A resource authored in TypeScript and one authored in YAML are the same resource to Roark (both keyed by <kind>/<name>), so you can migrate one kind at a time, or keep prompts as .md files and the rest in code.

Node SDK

Full setup for @roarkanalytics/sdk: install, authentication, and the rest of the API surface the same client exposes.