@edge-base/react-native 0.1.4 → 0.2.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 +60 -1
- package/dist/index.cjs +1246 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +169 -1
- package/dist/index.d.ts +169 -1
- package/dist/index.js +1246 -11
- package/dist/index.js.map +1 -1
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/edge-base/edgebase">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/edge-base/edgebase/main/docs/static/img/logo-icon.svg" alt="EdgeBase Logo" width="72" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
1
7
|
<h1 align="center">@edge-base/react-native</h1>
|
|
2
8
|
|
|
3
9
|
<p align="center">
|
|
@@ -37,7 +43,9 @@ It keeps the familiar browser SDK shape while adding the pieces mobile apps need
|
|
|
37
43
|
|
|
38
44
|
If you are building a browser-only app, use [`@edge-base/web`](https://www.npmjs.com/package/@edge-base/web) instead.
|
|
39
45
|
|
|
40
|
-
EdgeBase is
|
|
46
|
+
EdgeBase is the open-source edge-native BaaS that runs on Edge, Docker, and Node.js.
|
|
47
|
+
|
|
48
|
+
This package is one part of the wider EdgeBase platform. For the full platform, CLI, Admin Dashboard, server runtime, docs, and all public SDKs, see the main repository: [edge-base/edgebase](https://github.com/edge-base/edgebase).
|
|
41
49
|
|
|
42
50
|
> Beta: the package is already usable, but some APIs may still evolve before general availability.
|
|
43
51
|
|
|
@@ -217,6 +225,57 @@ When you pass `appState` to `createClient()`, the SDK automatically coordinates
|
|
|
217
225
|
- background/inactive: disconnect realtime transports to reduce battery and network use
|
|
218
226
|
- foreground: refresh auth state and reconnect realtime transports
|
|
219
227
|
|
|
228
|
+
## Room Media Transports
|
|
229
|
+
|
|
230
|
+
React Native now exposes the same top-level room media transport entrypoint as the web SDK:
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
const room = client.room('calls', 'demo');
|
|
234
|
+
await room.join();
|
|
235
|
+
|
|
236
|
+
const transport = room.media.transport({
|
|
237
|
+
provider: 'cloudflare_realtimekit',
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
await transport.connect({
|
|
241
|
+
name: 'June',
|
|
242
|
+
customParticipantId: 'mobile-june',
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
await transport.enableAudio();
|
|
246
|
+
await transport.enableVideo();
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Available providers:
|
|
250
|
+
|
|
251
|
+
- `cloudflare_realtimekit`
|
|
252
|
+
Uses Cloudflare RealtimeKit for managed media sessions
|
|
253
|
+
- `p2p`
|
|
254
|
+
Uses direct peer-to-peer media with signaling through `room.signals`
|
|
255
|
+
|
|
256
|
+
Install the matching optional peer dependencies for the transport you use:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
npm install @cloudflare/realtimekit-react-native
|
|
260
|
+
npm install @cloudflare/react-native-webrtc
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Practical integration notes from the current host-app smoke matrix:
|
|
264
|
+
|
|
265
|
+
- `cloudflare_realtimekit` currently expects React Native `0.77+`
|
|
266
|
+
- iOS needs the usual `cd ios && pod install`
|
|
267
|
+
- Android apps using `@cloudflare/realtimekit-react-native` need a `blob_provider_authority` string resource
|
|
268
|
+
- current host-app smoke builds succeeded on both iOS simulator and Android debug
|
|
269
|
+
|
|
270
|
+
```xml
|
|
271
|
+
<string name="blob_provider_authority">${applicationId}.blobs</string>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
For setup details and provider tradeoffs, see the room media docs:
|
|
275
|
+
|
|
276
|
+
- [Room Media Overview](https://edgebase.fun/docs/room/media)
|
|
277
|
+
- [Room Media Setup](https://edgebase.fun/docs/room/media-setup)
|
|
278
|
+
|
|
220
279
|
## Platform Differences vs `@edge-base/web`
|
|
221
280
|
|
|
222
281
|
| Feature | Web | React Native |
|