CDN

Summary

This docs site doubles as a CDN for the Soma distribution files. Instead of copying the flatpack into your project, you can reference the files directly from soma.nware.io: one <link> and one <script> and the full component library is available.

Files

FileWhat it is
/cdn/soma.cssThe complete stylesheet: every soma-* component, all three themes, density modes, the a11y layer.
/cdn/soma.umd.cjsUMD bundle for plain <script> tags. Sets window.Soma and runs auto-init on DOMContentLoaded — the drop-in for server-rendered portal pages.
/cdn/soma.jsESM build for <script type="module"> or bundlers consuming a URL import. Default-exports the Soma API.
/cdn/*.mapSource maps for both JS builds; DevTools picks them up automatically.
/cdn/soma.d.tsTypeScript definitions for the whole Soma.* API — editors use them for autocomplete even in plain-JS projects. See Getting started.
/cdn/cdn-sri.jsonPublished sha384 integrity hashes for this build's bundles. See Integrity below.
/cdn/nware-soma.zipThe complete flatpack as a downloadable archive. See Download below.

Download

If you'd rather vendor the files into your project (offline builds, air-gapped deployments, checked-in static assets), grab the flatpack archive instead of referencing the CDN:

ArchiveContents
nware-soma.zip
/cdn/nware-soma.zip
Latest release. Extracts to a nware-soma-<version>/ folder containing soma.css, soma.js, soma.umd.cjs, both source maps, soma.d.ts (editor types), web-types.json + soma.code-snippets (IDE metadata; see Getting started), and the Apache 2.0 LICENSE + NOTICE (keep these two alongside the files when redistributing).
/cdn/<version>/nware-soma-<version>.zipThe same archive under the version-pinned path, e.g. /cdn/0.1.0/nware-soma-0.1.0.zip.

The archive contents are byte-identical to the loose CDN files, so swapping between vendored and CDN delivery never changes behaviour. This is the same dist/ flatpack the nware-portal serves as static resources.

Latest vs pinned

PathBehaviour
/cdn/soma.cssLatest. Always the currently deployed release. Cached for 5 minutes, so consumers pick up a new release quickly — and may also pick up breaking changes. Fine for internal tools that track Soma.
/cdn/0.1.0/soma.cssPinned. Version-stamped path, cached as immutable for a year. Use this in anything you don't redeploy alongside Soma.

Version retention

Version-pinned paths are permanent: every released version is archived in the repository (cdn-releases/) and baked into each site image, so /cdn/<version>/… keeps serving byte-identical files after later releases. Pin versions (and their hashes below) with confidence; only the un-versioned "latest" paths move. Each release's docs site is also archived at /archive/<version>/ alongside the live site, so documentation matching your pinned version stays browsable.

HTML

<!-- classic script tag (server-rendered pages) -->
<link rel="stylesheet" href="https://soma.nware.io/cdn/0.1.0/soma.css" />
<script src="https://soma.nware.io/cdn/0.1.0/soma.umd.cjs"></script>

<!-- or as a module -->
<script type="module">
  import Soma from 'https://soma.nware.io/cdn/0.1.0/soma.js';
  Soma.toast({ title: 'Hello from the CDN', appearance: 'success' });
</script>

Integrity (SRI)

For the version-pinned CDN files you can pin content hashes too; the browser then refuses the file if it ever differs from what you audited. The sha384 hashes for every version this CDN serves:

VersionFileintegrity
Loading…
<link rel="stylesheet"
      href="https://soma.nware.io/cdn/0.1.0/soma.css"
      integrity="sha384-…"
      crossorigin="anonymous" />

Pair integrity with the version-pinned paths only: the un-versioned /cdn/… files change on every release, so a pinned hash there would break on purpose.

Notes

  • CORS is open (Access-Control-Allow-Origin: *), so ESM imports and source maps work from any origin.
  • Everything is served gzipped with correct MIME types (including .cjs and .map).
  • Soma is zero-dependency: no jQuery, no framework, nothing else to load.
  • The dev/test environment at soma.dev.nware.io serves the same layout for pre-release verification.
  • Prefer npm install @nware/soma when you have a bundler; see Getting started.