Skip to main content
If you already run a token pipeline, Livry can just be its source. Fetch the DTCG document in CI, generate what your platforms need, and ship the output — your app has no runtime dependency on Livry at all. Theme integration required: a pair whose library is Build-time tokens (Style Dictionary). It builds tokens.dtcg.json, tokens.json and tokens.flat.json.

Which file

Use tokens.dtcg.json, not tokens.json.tokens.dtcg.json keeps aliases as written — {color.brand}. Style Dictionary and every other DTCG tool resolve references themselves, and that is where their whole reference-graph feature set lives: outputs that preserve the relationship, per-platform reference resolution, warnings about broken links.tokens.json has every alias already flattened to a value. Feeding it to a DTCG tool throws away the relationships it was built to use.

1. Fetch in CI

Pin the version. /7/ rather than /latest/: a build should not change because somebody published while it was running, and two builds of the same commit should produce the same bytes.Bump the number as a deliberate commit, like any other dependency.
--fail matters — without it curl writes the error body to your tokens file and the build continues with garbage.

2. Configure Style Dictionary

Many brands

A build-time pipeline generates one output per brand, so loop:
This is the trade-off. A build-time pipeline means a new brand needs a build and a deploy — you have given up the runtime brand switch that makes Livry’s stylesheet integration instant.If you onboard brands frequently, consider using tokens.css at runtime and keeping the build-time pipeline only for the platforms that genuinely need generated output — native apps, email templates, design-tool sync.
A Theme can hold both integrations at once and build both file sets.

Discovering brands and versions

Rather than hard-coding the list, ask the API:
The Theme’s servingUrls.version is the newest published version, so “pin to whatever is newest at build time, and record it” is a few lines.
The API is not yet reachable with a machine credential — see Authentication. Until it is, a CI integration means a user-backed token, which is not something to put in a shared pipeline. Hard-coding the list is the honest recommendation today.

Other DTCG tools

Anything that reads the DTCG format works the same way — fetch tokens.dtcg.json and point the tool at it. $extends and $ref are the two places to be careful, because Livry preserves them without applying them; if your tool emits either, Livry will store it faithfully and ignore it. See Tokens.