@reactor-team/js-sdk 2.12.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +209 -172
- package/dist/index.cjs +2478 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1234 -0
- package/dist/index.d.ts +952 -1076
- package/dist/index.js +1707 -4111
- package/dist/index.js.map +1 -1
- package/dist/wasm/README.md +151 -0
- package/dist/wasm/package.json +21 -0
- package/dist/wasm/reactor_wasm.d.ts +422 -0
- package/dist/wasm/reactor_wasm.js +1428 -0
- package/dist/wasm/reactor_wasm_bg.wasm +0 -0
- package/dist/wasm/reactor_wasm_bg.wasm.d.ts +53 -0
- package/package.json +36 -60
- package/LICENSE +0 -201
- package/NOTICE +0 -5
- package/dist/index.d.mts +0 -1358
- package/dist/index.mjs +0 -4750
- package/dist/index.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,242 +1,279 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Reactor JS SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@reactor-team/js-sdk)
|
|
4
|
+
[](https://github.com/reactor-team/reactor-client-sdks/actions)
|
|
5
|
+
[](https://github.com/reactor-team/reactor-client-sdks/blob/main/LICENSE)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Connect a browser app to a live [Reactor](https://reactor.inc) model.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Quickstart
|
|
12
|
-
|
|
13
|
-
The fastest path is `create-reactor-app`, which scaffolds a Next.js app with auth wired up:
|
|
9
|
+
## Install
|
|
14
10
|
|
|
15
11
|
```bash
|
|
16
|
-
|
|
17
|
-
cd my-app && pnpm install && pnpm dev
|
|
12
|
+
npm install @reactor-team/js-sdk
|
|
18
13
|
```
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
`dist/` ships plain CJS and ESM builds plus `.d.ts` types — a bundler-free,
|
|
16
|
+
non-TypeScript app can `require()` or `import` this package directly, no
|
|
17
|
+
build step of its own required.
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
21
20
|
|
|
22
21
|
```ts
|
|
23
|
-
|
|
24
|
-
import { NextResponse } from "next/server";
|
|
25
|
-
|
|
26
|
-
export async function POST() {
|
|
27
|
-
const r = await fetch("https://api.reactor.inc/tokens", {
|
|
28
|
-
method: "POST",
|
|
29
|
-
headers: {
|
|
30
|
-
"Reactor-API-Key": process.env.REACTOR_API_KEY!,
|
|
31
|
-
"Content-Type": "application/json",
|
|
32
|
-
},
|
|
33
|
-
body: JSON.stringify({
|
|
34
|
-
authorization_details: [
|
|
35
|
-
{
|
|
36
|
-
type: "session",
|
|
37
|
-
resources: { models: { match: ["your-org/your-model-name"] } },
|
|
38
|
-
constraints: { max_sessions: 10 },
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
}),
|
|
42
|
-
});
|
|
43
|
-
const { jwt } = await r.json();
|
|
44
|
-
return NextResponse.json({ jwt });
|
|
45
|
-
}
|
|
46
|
-
```
|
|
22
|
+
import { Reactor } from "@reactor-team/js-sdk";
|
|
47
23
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
import { ReactorProvider, ReactorView } from "@reactor-team/js-sdk";
|
|
24
|
+
const reactor = new Reactor({
|
|
25
|
+
modelName: "my-model",
|
|
26
|
+
jwt: () => fetchToken(), // or a plain string; omit for an unauthenticated local runtime
|
|
27
|
+
});
|
|
53
28
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.then(({ jwt }) => jwt);
|
|
29
|
+
reactor.on("statusChanged", (status) => console.log("status:", status));
|
|
30
|
+
reactor.on("error", (error) => console.error(error.code, error.message));
|
|
57
31
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<ReactorProvider
|
|
62
|
-
modelName="your-model-name"
|
|
63
|
-
jwtToken={token}
|
|
64
|
-
connectOptions={{ autoConnect: true }}
|
|
65
|
-
>
|
|
66
|
-
<ReactorView className="w-full aspect-video" />
|
|
67
|
-
</ReactorProvider>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
32
|
+
await reactor.connect();
|
|
33
|
+
// ... reactor.getStatus() === "ready" once the session is up ...
|
|
34
|
+
await reactor.disconnect(); // ends the session AND frees the wasm client
|
|
70
35
|
```
|
|
71
36
|
|
|
72
|
-
|
|
37
|
+
The token can also be passed directly to `connect(jwt, options?)` instead of
|
|
38
|
+
the constructor.
|
|
73
39
|
|
|
74
|
-
|
|
40
|
+
Construction never touches WebAssembly — `reactor-wasm` is fetched and
|
|
41
|
+
instantiated lazily on the first `connect()`/`reconnect()` call, and cached
|
|
42
|
+
after that, so building a `Reactor` you never connect costs nothing.
|
|
75
43
|
|
|
76
|
-
##
|
|
44
|
+
## `disconnect()` and disposal
|
|
77
45
|
|
|
78
|
-
|
|
46
|
+
`disconnect(recoverable = false)`:
|
|
79
47
|
|
|
80
|
-
|
|
48
|
+
- **`disconnect()`** (the default) ends the session server-side and frees the
|
|
49
|
+
underlying wasm resource graph — the pump, dispatcher and heartbeat tasks —
|
|
50
|
+
in one step. The `Reactor` instance itself is still usable: a later
|
|
51
|
+
`connect()`/`reconnect()` lazily builds a fresh wasm client.
|
|
52
|
+
- **`disconnect(true)`** ends the session but keeps the wasm client alive, so
|
|
53
|
+
a later `connect()`/`reconnect()` doesn't have to reload wasm and
|
|
54
|
+
reconstruct it from scratch.
|
|
55
|
+
- **`using reactor = new Reactor(...)`** (or calling `reactor[Symbol.dispose]()`
|
|
56
|
+
directly) tears the instance down for good — same resource release as a
|
|
57
|
+
plain `disconnect()`, plus dropping every registered event handler. Do this
|
|
58
|
+
when you're done with the object entirely, not on every disconnect.
|
|
81
59
|
|
|
82
|
-
|
|
60
|
+
## Status and session id
|
|
83
61
|
|
|
84
|
-
```
|
|
85
|
-
|
|
62
|
+
```ts
|
|
63
|
+
reactor.getStatus(); // ReactorStatus: "disconnected" | "connecting" | "waiting" | "ready"
|
|
64
|
+
reactor.getSessionId(); // string | undefined
|
|
86
65
|
```
|
|
87
66
|
|
|
88
|
-
|
|
67
|
+
`reactor-wasm`'s own binding uses the terser `status()`/`sessionId()`
|
|
68
|
+
internally — not exposed here yet, kept simple until there's a real reason
|
|
69
|
+
to add them alongside `getStatus()`/`getSessionId()`.
|
|
89
70
|
|
|
90
|
-
|
|
71
|
+
## Events
|
|
91
72
|
|
|
92
|
-
|
|
73
|
+
`on(event, handler)` / `off(event, handler)` / `once(event, handler)`, over:
|
|
93
74
|
|
|
94
|
-
|
|
95
|
-
|
|
75
|
+
| Event | Payload |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `statusChanged` | `ReactorStatus` |
|
|
78
|
+
| `sessionIdChanged` | `string \| undefined` |
|
|
79
|
+
| `error` | `ReactorError` |
|
|
80
|
+
| `message` | `ReactorMessage` — application-scope payload from the model |
|
|
81
|
+
| `runtimeMessage` | `ReactorMessage` — platform-scope payload (moderation, clip/recording lifecycle, ...) |
|
|
82
|
+
| `schemaReceived` | `ModelSchema` — see `getSchema()` below |
|
|
83
|
+
| `capabilitiesReceived` | `Capabilities` — see `getCapabilities()` below |
|
|
84
|
+
| `trackReceived` | `(name, track: MediaStreamTrack, stream: MediaStream, mid: string \| undefined)` |
|
|
85
|
+
| `statsUpdate` | `ConnectionStats` |
|
|
96
86
|
|
|
97
|
-
|
|
98
|
-
const { status, sendCommand } = useReactor((s) => ({
|
|
99
|
-
status: s.status,
|
|
100
|
-
sendCommand: s.sendCommand,
|
|
101
|
-
}));
|
|
87
|
+
## Model schema and capabilities
|
|
102
88
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Set prompt
|
|
109
|
-
</button>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
89
|
+
```ts
|
|
90
|
+
reactor.getSchema(); // ModelSchema | undefined — the model's OpenAPI command/webhook doc
|
|
91
|
+
reactor.getCapabilities(); // Capabilities | undefined — negotiated tracks, command set if exposed
|
|
92
|
+
reactor.on("schemaReceived", (schema) => ...);
|
|
93
|
+
reactor.on("capabilitiesReceived", (capabilities) => ...);
|
|
112
94
|
```
|
|
113
95
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
96
|
+
Both are pushed automatically once available after `connect()` — no explicit request needed —
|
|
97
|
+
and both are `undefined` until their first event fires. Neither is mirrored into the React
|
|
98
|
+
store's reactive state; reach them off the `Reactor` instance the same way (`useReactor((s) =>
|
|
99
|
+
s.internal.reactor)` — see [React](#react) below).
|
|
117
100
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<WebcamStream track="webcam" className="w-48 aspect-video" />
|
|
122
|
-
</ReactorProvider>
|
|
123
|
-
```
|
|
101
|
+
`getSessionInfo()` also returns a `capabilities` field, but it's the **raw wire shape**
|
|
102
|
+
(snake_case), not this translated one — prefer `getCapabilities()`/`capabilitiesReceived` unless
|
|
103
|
+
you specifically need the untranslated session resource.
|
|
124
104
|
|
|
125
|
-
|
|
105
|
+
## Recording and clips
|
|
126
106
|
|
|
127
|
-
|
|
107
|
+
```ts
|
|
108
|
+
const clip = await reactor.requestClip(10); // last 10 seconds
|
|
109
|
+
// or: const clip = await reactor.requestRecording(); // the whole session so far
|
|
128
110
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
function FrameCounter() {
|
|
133
|
-
const [frame, setFrame] = useState(0);
|
|
134
|
-
useReactorMessage((msg) => {
|
|
135
|
-
if (msg.type === "state") setFrame(msg.data.current_frame);
|
|
136
|
-
});
|
|
137
|
-
return <div>Frame: {frame}</div>;
|
|
138
|
-
}
|
|
111
|
+
// downloadClipAsFile() doesn't inherit the Reactor instance's JWT — pass it
|
|
112
|
+
// explicitly (omit `jwt` entirely against a local runtime, which is auth-free).
|
|
113
|
+
const blob = await reactor.downloadClipAsFile(clip, "clip.mp4", { jwt: await fetchToken() });
|
|
139
114
|
```
|
|
140
115
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
`useReactor((s) => s.
|
|
116
|
+
`requestClip()`/`requestRecording()`/`downloadClipAsFile()` are directly on `Reactor` — there's
|
|
117
|
+
no separate recording client to construct. All three are also bound on the React store
|
|
118
|
+
(`useReactor((s) => s.requestClip)`, etc.) for the common case; `useClipDownload` below wraps
|
|
119
|
+
`downloadClipAsFile` in a progress/error state machine for a custom UI.
|
|
120
|
+
`downloadClipAsFile(clip, filename?, options?)` polls the clip's manifest
|
|
121
|
+
until ready, remuxes the fragmented chunks into a flat, faststart MP4, and (unless
|
|
122
|
+
`filename: null` is passed) triggers the download; pass `options.onProgress` for progress UI.
|
|
144
123
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
124
|
+
For a React preview instead of a download, `ClipPlayer`/`ClipDownloadButton`/`useClipDownload`
|
|
125
|
+
cover playback and download UI directly. Neither requires a `ReactorProvider`, but each needs a
|
|
126
|
+
JWT source outside local-dev mode — either an explicit `getJwt`, as below, or mount them under a
|
|
127
|
+
`ReactorProvider` and omit `getJwt` to inherit its resolver:
|
|
148
128
|
|
|
149
129
|
```tsx
|
|
150
|
-
|
|
151
|
-
uploadFile: s.uploadFile,
|
|
152
|
-
sendCommand: s.sendCommand,
|
|
153
|
-
}));
|
|
130
|
+
import { ClipPlayer, ClipDownloadButton } from "@reactor-team/js-sdk";
|
|
154
131
|
|
|
155
|
-
|
|
156
|
-
|
|
132
|
+
<ClipPlayer clip={clip} getJwt={() => fetchToken()} />
|
|
133
|
+
<ClipDownloadButton clip={clip} getJwt={() => fetchToken()} filename="clip.mp4" />
|
|
157
134
|
```
|
|
158
135
|
|
|
159
|
-
|
|
136
|
+
`ClipPlayer` streams the clip with `hls.js` wherever Media Source Extensions exist (every
|
|
137
|
+
current browser, including iOS Safari 17.1+) and assembles a flat MP4 to play from memory on
|
|
138
|
+
the one iOS range that has none. Neither component requires a `ReactorProvider` — both work
|
|
139
|
+
directly off a `Clip` value, including clips loaded from fixtures or logs.
|
|
160
140
|
|
|
161
|
-
##
|
|
162
|
-
|
|
163
|
-
For non-React apps such as Electron shells, game engines, or Node scripts, use the `Reactor` class directly. It exposes the same surface as the React store, without the React glue:
|
|
141
|
+
## Stats and timings
|
|
164
142
|
|
|
165
143
|
```ts
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
modelName: "your-model-name",
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
reactor.on("statusChanged", (status) => console.log("status:", status));
|
|
174
|
-
reactor.on("message", (msg) => console.log("model:", msg));
|
|
175
|
-
reactor.on("trackReceived", (name, _track, stream) => {
|
|
176
|
-
if (name === "main_video") videoEl.srcObject = stream;
|
|
177
|
-
});
|
|
144
|
+
reactor.getStats(); // ConnectionStats | undefined
|
|
145
|
+
reactor.getConnectionTimings(); // ConnectionTimings | undefined
|
|
146
|
+
reactor.on("statsUpdate", (stats) => console.log(stats.rtt, stats.packetLossRatio));
|
|
147
|
+
```
|
|
178
148
|
|
|
179
|
-
|
|
149
|
+
While the session is `"ready"`, `getPeerConnection().getStats()` is polled
|
|
150
|
+
every two seconds and reduced into a `ConnectionStats` — RTT, ICE candidate
|
|
151
|
+
type, incoming/outgoing bitrate (both estimated and real-time), video FPS,
|
|
152
|
+
packet loss ratio, and jitter — emitted as `statsUpdate` and readable
|
|
153
|
+
directly off `getStats()`. Both are `undefined` before the first sample, and
|
|
154
|
+
polling stops (clearing `getStats()`) as soon as the session leaves `"ready"`
|
|
155
|
+
for any reason, not just an explicit `disconnect()`.
|
|
156
|
+
|
|
157
|
+
`getConnectionTimings()` (also folded into every `ConnectionStats.connectionTimings`)
|
|
158
|
+
is a millisecond breakdown of the most recent `connect()`/`reconnect()`
|
|
159
|
+
handshake: `sessionCreationMs`, `transportConnectingMs`, `totalMs`.
|
|
160
|
+
|
|
161
|
+
## Errors
|
|
162
|
+
|
|
163
|
+
One class, `ReactorError`, for both the `error` event payload and a rejected
|
|
164
|
+
call's error. It carries `code`, `message`, `recoverable`, `status?`,
|
|
165
|
+
`operation?`, `retry_after_ms?`, `timestamp_ms`, and the compatibility
|
|
166
|
+
aliases `timestamp`/`retryAfter`.
|
|
167
|
+
|
|
168
|
+
It's the base of a typed hierarchy keyed by `code` — `reactor-core`'s own
|
|
169
|
+
per-failure-kind classification: `NetworkError`, `UnauthorizedError`,
|
|
170
|
+
`NotFoundError`, `ConflictError`, `RateLimitedError`, `BadRequestError`,
|
|
171
|
+
`ServerError`, `VersionMismatchError`, `DecodeError`, `InvalidStateError`,
|
|
172
|
+
`SessionTerminalError`, `MessageTooLargeError`, `TransportError`,
|
|
173
|
+
`DisconnectedError`, `RequestTimeoutError`, `AbortedError`. An unrecognized
|
|
174
|
+
code falls back to the base class. `instanceof` and matching `error.code`
|
|
175
|
+
are equivalent — pick whichever reads better at the call site:
|
|
180
176
|
|
|
181
|
-
|
|
177
|
+
```ts
|
|
178
|
+
import { Reactor, ReactorError, UnauthorizedError } from "@reactor-team/js-sdk";
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
await reactor.connect();
|
|
182
|
+
} catch (error) {
|
|
183
|
+
if (error instanceof UnauthorizedError) {
|
|
184
|
+
await refreshToken();
|
|
185
|
+
} else if (error instanceof ReactorError && error.recoverable) {
|
|
186
|
+
await reactor.reconnect();
|
|
187
|
+
}
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
182
190
|
```
|
|
183
191
|
|
|
184
|
-
|
|
192
|
+
`getLastError()` returns the most recent `ReactorError`, from either an
|
|
193
|
+
`error` event or a rejected call.
|
|
185
194
|
|
|
186
|
-
|
|
195
|
+
`sendCommand(command, data?, scope?)` awaits the model's correlated reply and
|
|
196
|
+
resolves with it (`ReactorMessage | undefined`); it never throws — a failure
|
|
197
|
+
surfaces through `getLastError()`/the `error` event instead, and the call
|
|
198
|
+
resolves `undefined`. Every other call that can fail (`connect`,
|
|
199
|
+
`publishTrack`, `uploadFile`, ...) throws normally.
|
|
187
200
|
|
|
188
|
-
|
|
201
|
+
## React
|
|
189
202
|
|
|
190
203
|
```tsx
|
|
191
|
-
import {
|
|
192
|
-
import
|
|
204
|
+
import { useCallback } from "react";
|
|
205
|
+
import { ReactorProvider, useReactor } from "@reactor-team/js-sdk";
|
|
206
|
+
|
|
207
|
+
function App() {
|
|
208
|
+
// Stable across renders — see the note on ReactorProvider below for why
|
|
209
|
+
// this matters.
|
|
210
|
+
const jwt = useCallback(() => fetchToken(), []);
|
|
193
211
|
|
|
194
|
-
function ClipModal({ clip, jwt }: { clip: Clip; jwt: string }) {
|
|
195
212
|
return (
|
|
196
|
-
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
</>
|
|
213
|
+
<ReactorProvider modelName="my-model" jwtToken={jwt}>
|
|
214
|
+
<Status />
|
|
215
|
+
</ReactorProvider>
|
|
200
216
|
);
|
|
201
217
|
}
|
|
202
|
-
```
|
|
203
218
|
|
|
204
|
-
|
|
219
|
+
function Status() {
|
|
220
|
+
const { status, sendCommand } = useReactor((s) => ({
|
|
221
|
+
status: s.status,
|
|
222
|
+
sendCommand: s.sendCommand,
|
|
223
|
+
}));
|
|
205
224
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
225
|
+
return (
|
|
226
|
+
<div>
|
|
227
|
+
{status}
|
|
228
|
+
<button onClick={() => sendCommand("set_image", { url: "..." })}>Send</button>
|
|
229
|
+
</div>
|
|
230
|
+
);
|
|
231
|
+
}
|
|
209
232
|
```
|
|
210
233
|
|
|
211
|
-
|
|
234
|
+
`react` is a peer dependency — install it yourself, matching your app's own
|
|
235
|
+
version. `ReactorView` (renders one or two named tracks into a single
|
|
236
|
+
`<video>`/`<audio>` element) and `WebcamStream` (captures and publishes the
|
|
237
|
+
local camera/mic) cover the common send/receive media UI without hand-rolling
|
|
238
|
+
`getTrackByName()`/`publishTrack()` yourself.
|
|
239
|
+
|
|
240
|
+
`apiUrl`/`modelName`/`local`/`modelTracks`/`jwtToken`/`connectOptions` are live
|
|
241
|
+
(including `connectOptions.autoConnect`): changing any of them tears down the
|
|
242
|
+
current `Reactor` and builds a fresh one (there's no way to reconnect an
|
|
243
|
+
existing instance with a different model or endpoint). Pass a stable
|
|
244
|
+
`jwtToken` and stable `modelTracks`/`connectOptions` references
|
|
245
|
+
(`useCallback`/`useMemo`, or hoist them outside the component) if you don't
|
|
246
|
+
want an unrelated parent re-render to rebuild the connection.
|
|
247
|
+
|
|
248
|
+
`useReactor(selector)` also carries `sessionId`, `lastError`, `lastMessage`,
|
|
249
|
+
and action bindings for `connect`/`disconnect`/`reconnect`/`sendCommand`/
|
|
250
|
+
`publish`/`unpublish`/`pauseTrack`/`resumeTrack`/`uploadFile`/`requestClip`/
|
|
251
|
+
`requestRecording`/`downloadClipAsFile`. For anything else — tracks, schema,
|
|
252
|
+
capabilities, stats, the raw event emitter — `useReactor((s) =>
|
|
253
|
+
s.internal.reactor)` gets you the underlying `Reactor` instance directly.
|
|
254
|
+
|
|
255
|
+
## Development
|
|
212
256
|
|
|
213
257
|
```bash
|
|
214
|
-
|
|
258
|
+
mise run install:js # npm install
|
|
259
|
+
mise run lint:js # eslint + tsc --noEmit
|
|
260
|
+
mise run build:js # tsup -> dist/, then copies reactor-wasm's pkg/ into dist/wasm
|
|
261
|
+
mise run test:js # vitest — pure-JS unit tests against a mocked ReactorClient, no wasm build needed
|
|
215
262
|
```
|
|
216
263
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
Full walkthrough, error codes, and the headless `useClipDownload` hook: [Recordings](https://docs.reactor.inc/concepts/recordings).
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
|
|
223
|
-
## Typed model SDKs
|
|
224
|
-
|
|
225
|
-
For models with a published typed SDK, prefer [`@reactor-models/<name>`](https://www.npmjs.com/org/reactor-models). It re-exports everything here and adds typed commands, messages, and hooks for one specific model. Use this base SDK when the model doesn't have a typed package yet, or when you want to stay model-agnostic.
|
|
226
|
-
|
|
227
|
-
---
|
|
264
|
+
`build:js` fails fast with a clear message if `crates/reactor-wasm/pkg`
|
|
265
|
+
doesn't exist yet — run `mise run build:wasm` first.
|
|
228
266
|
|
|
229
|
-
|
|
267
|
+
See the repo-wide [`CONTRIBUTING.md`](../../CONTRIBUTING.md) for the rest
|
|
268
|
+
(DCO, commit conventions, opening a PR).
|
|
230
269
|
|
|
231
|
-
|
|
232
|
-
| -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
233
|
-
| `Reactor` | [Reactor class](https://docs.reactor.inc/api-reference/reactor-class) |
|
|
234
|
-
| `<ReactorProvider>`, `<ReactorView>`, `<WebcamStream>` | [React components](https://docs.reactor.inc/api-reference/react-components) |
|
|
235
|
-
| `useReactor`, `useReactorMessage`, `useStats` | [React hooks](https://docs.reactor.inc/api-reference/react-hooks) |
|
|
236
|
-
| `<ClipPlayer>`, `<ClipDownloadButton>`, `useClipDownload`, `RecordingClient`, `RecordingError`, `fetchPlaylist`, `parsePlaylist` | [Recordings](https://docs.reactor.inc/concepts/recordings) |
|
|
270
|
+
## Documentation
|
|
237
271
|
|
|
238
|
-
|
|
272
|
+
The [full documentation](https://docs.reactor.inc/sdk-reference/using-the-sdk)
|
|
273
|
+
covers platform concepts and the other language SDKs. See
|
|
274
|
+
[`CHANGELOG.md`](./CHANGELOG.md) for what changed release to release,
|
|
275
|
+
including 3.0.0's breaking changes from the legacy 2.x SDK.
|
|
239
276
|
|
|
240
277
|
## License
|
|
241
278
|
|
|
242
|
-
|
|
279
|
+
Apache-2.0 — see [`LICENSE`](../../LICENSE).
|