1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# @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
```bash
npm i @publicdomainrelay/atlibs
```
```js
import { localModule, runModule } from '@publicdomainrelay/atlibs/run-module/index.js'
```
A page maps the same paths through its import map:
```html
<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 is `server/cli.mjs`),
`oauth-server` (needs the optional peers `@atproto/oauth-client-node` and `@atproto/jwk-jose`),
`serviceauth` (`node:crypto`)
Node 25 or later (`Uint8Array.prototype.toBase64`); browsers: Chrome 140, Firefox 133, Safari 18.2.
Public domain ([Unlicense](https://unlicense.org)).