The runtime SDK for niles apps. Components, CSS, and the nc client that every niles app uses to talk to its backend.
You do not install this. niles apps consume it directly from the browser via esm.sh.
In your index.html:
<link rel="stylesheet" href="https://esm.sh/gh/roycw/niles-sdk@v2.0.0/css/imports.css">
<script type="module">
import nc from "https://esm.sh/gh/roycw/niles-sdk@v2.0.0";
window.nc = nc;
</script>In your app code:
import m from "https://esm.sh/mithril@2.2.2";
import nc from "https://esm.sh/gh/roycw/niles-sdk@v2.0.0";
import { Button, Card, TextField } from "https://esm.sh/gh/roycw/niles-sdk@v2.0.0/components";Pin to a specific version tag (@v2.0.0) in production. @latest resolves to the most recent release; useful for prototyping, risky for running apps.
niles-sdk.js— thencclient (auth, database, storage, edge functions, integrations, subscriptions, user, ...). Same surface as documented in your project's.claude/docs/.components/— Mithril UI components:Button,Card,Dialog,Popover,Table,TextField, etc. All exported fromcomponents/index.js.css/—imports.cssis the entrypoint; pulls Open Props UI base + per-component styles.analytics.js,visual-editor.js— internal scripts injected by the niles runtime; not for direct import.
Don't fork. Two supported escape hatches:
- Looks — override CSS variables in your project's own
theme.css. The components use:where()low-specificity selectors so overrides win without!important. - Behavior — wrap components in your own. Build
MyPrimaryActionthat internally callsm(Button, { variant: "filled", ... }).
Cut a release with a semver tag:
git tag v1.0.1
git push origin v1.0.1esm.sh caches by tag — the moment the tag is on GitHub, esm.sh/gh/roycw/niles-sdk@v1.0.1/... resolves to it. (@latest may take a few minutes to refresh; append ?reload to a URL to force a CDN refresh during testing.)
No npm publish step. esm.sh's gh/ registry serves the repo directly.