This guide is the consumer path: you have the npm package and the Android AAR,
and you want an app running. The framework repo’s own docs describe its
internal structure; this is the “make it mine” path.
Want it running instead of described? The repo ships a minimal runnable
consumer at examples/consumer-basic/ (private workspace package): its own
worklet entry, an app.basic plugin (one invoke + one backend → web push),
the web layer, and a real-stack e2e. It is the copy-paste starting point for
everything on this page:
Terminal window
npmrunbuild:pkg# compile @ekrooh/bare to dist/ (prereq)
The frontend is a normal Vite page. The backend is a Bare worklet that runs
your entry. The host (Android shell) starts the worklet, injects the one-time
bootstrap nonce, and loads the loopback-served page.
createWorkletRuntime is synchronous and throws on auth: false unless
deviceMode: false is set too. resolveWorkletConfig() reads the host-provided config from Bare.argv
([webAssets, storage, cache]). Under the bare CLI it parses labeled tokens;
dev mode (auth off) needs an explicit mode=dev.
On device the page is served by the loopback server, so the WebSocket defaults
to the page’s own origin (ws://<location.host>) and the injected
window.__ekrooh = { bootstrap } (a one-time nonce) boots the bare_session_<port>
cookie automatically — the raw token is never given to page JS. In browser
dev, pass the backend URL explicitly:
Android: see Android AAR Setup + Host Handoff.
When you copy the reference build.gradle (the JS Exec tasks) into your own
repo, read Android Host Build first — it documents
the flat-node_modules requirement, the repo-root working dir, and how to pass
the entry package to bare-link.