@publicdomainrelay/atlibs
atlibs runs WebAssembly modules published as atproto records, in a browser page or a Node server. A
module plans XRPC calls; the host makes them with the user's session. ESM, no build step, no
dependencies. Docs, the Rust host and the atlibs CLI: https://knotless.dev/johnandersen777.bsky.social/atlibs
npm i @publicdomainrelay/atlibs
import { localModule, runModule } from '@publicdomainrelay/atlibs/run-module/index.js'
A page maps the same paths through its import map:
<script type="importmap">
{
"imports": {
"@atproto/oauth-client-browser": "https://esm.sh/@atproto/oauth-client-browser@0.5.14",
"atlibs/": "https://cdn.jsdelivr.net/npm/@publicdomainrelay/atlibs@0.5.0/src/"
}
}
</script>
Entry points
Every src/<name>/index.js is @publicdomainrelay/atlibs/<name>/index.js.
- Browser and Node:
run-module,compose,mcp,oauth,attest,didkey,encoding,cubit,component,plugin-context - Node only:
server(node:sqlite,node:fs,node:worker_threads; its CLI isserver/cli.mjs),oauth-server(needs the optional peers@atproto/oauth-client-nodeand@atproto/jwk-jose),serviceauth(node:crypto)
Node 25 or later (Uint8Array.prototype.toBase64); browsers: Chrome 140, Firefox 133, Safari 18.2.
Public domain (Unlicense).