@whereby.com/core 1.1.6 → 1.1.8
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 +68 -4
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/legacy-esm.js +1 -1
- package/dist/redux/index.cjs +1 -1
- package/dist/redux/index.js +1 -1
- package/dist/redux/index.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,21 +1,85 @@
|
|
|
1
1
|
# `@whereby.com/core`
|
|
2
2
|
|
|
3
|
-
`@whereby.com/core` is
|
|
3
|
+
`@whereby.com/core` is the low-level foundation of the Whereby SDK. It exposes a set of containers, actions, and client classes for working with local media and room connections. It's used to power the [Whereby Browser SDK](https://github.com/whereby/sdk/tree/main/packages/browser-sdk), [Whereby Assistants](https://github.com/whereby/sdk/tree/main/packages/assistant-sdk) and [React Native SDK](https://github.com/whereby/sdk/tree/main/packages/react-native-sdk) and other forms of Whereby meetings. It also contains utils which may be useful in custom experiences.
|
|
4
|
+
|
|
5
|
+
Use Core if you need **fine-grained control** over media and connections, or if you are building a custom integration outside of React. For most web apps, the Browser or React SDKs will be easier starting points.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```shell
|
|
8
|
-
npm install @whereby.com/
|
|
10
|
+
npm install @whereby.com/core
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
or
|
|
12
14
|
|
|
13
15
|
```shell
|
|
14
|
-
yarn add @whereby.com/
|
|
16
|
+
yarn add @whereby.com/core
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
or
|
|
18
20
|
|
|
19
21
|
```shell
|
|
20
|
-
pnpm add @whereby.com/
|
|
22
|
+
pnpm add @whereby.com/core
|
|
21
23
|
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
> [!IMPORTANT]
|
|
28
|
+
> In order to use `@whereby.com/core`, you must have a Whereby account
|
|
29
|
+
> from which you can create room URLs, either [manually or through the Whereby
|
|
30
|
+
> API](https://docs.whereby.com/whereby-101/creating-and-deleting-rooms).
|
|
31
|
+
|
|
32
|
+
### Getting Started
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { WherebyClient } from "@whereby.com/core";
|
|
36
|
+
|
|
37
|
+
const client = new WherebyClient();
|
|
38
|
+
|
|
39
|
+
// manage local devices
|
|
40
|
+
const localMedia = client.getLocalMedia();
|
|
41
|
+
|
|
42
|
+
// manage room connection
|
|
43
|
+
const roomConnection = client.getRoomConnection();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Core Concepts
|
|
47
|
+
|
|
48
|
+
#### Local Media
|
|
49
|
+
|
|
50
|
+
The `LocalMediaClient` controls microphones, cameras and local media tracks. It provides methods to request permissions, start and stop tracks, and switch between devices. It also exposes state such as the list of available devices and the current active tracks.
|
|
51
|
+
|
|
52
|
+
Typical usage:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
// you can pass options or a MediaStream
|
|
56
|
+
await localMedia.startMedia({ audio: true, video: true });
|
|
57
|
+
|
|
58
|
+
localMedia.toggleCamera(); // toggle camera on/off
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Room Connection
|
|
62
|
+
|
|
63
|
+
The `RoomConnectionClient` handles joining and leaving rooms, as well as observing connection and remote participant state.
|
|
64
|
+
|
|
65
|
+
Typical usage:
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
// initialize with your room URL
|
|
69
|
+
roomConnection.initialize({
|
|
70
|
+
roomUrl: "https://your-subdomain.whereby.com/your-room",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// join the room
|
|
74
|
+
roomConnection.joinRoom();
|
|
75
|
+
|
|
76
|
+
// listen for changes in connection state
|
|
77
|
+
roomConnection.subscribeToConnectionStatus((state) => {
|
|
78
|
+
console.log("Connection state changed:", state);
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Learn More
|
|
83
|
+
|
|
84
|
+
- Core SDK API Reference: [API Documentation](https://docs.whereby.com/reference/core-sdk-reference)
|
|
85
|
+
- Core SDK Quick Start Guide: [Quick Start Guide](https://docs.whereby.com/reference/core-sdk-reference/quick-start)
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/legacy-esm.js
CHANGED
package/dist/redux/index.cjs
CHANGED
package/dist/redux/index.js
CHANGED
package/dist/redux/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@whereby.com/core",
|
|
3
3
|
"description": "Core library for whereby.com sdk",
|
|
4
4
|
"author": "Whereby AS",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.8",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
"eslint": "^9.29.0",
|
|
59
59
|
"prettier": "^3.5.3",
|
|
60
60
|
"typescript": "^5.8.3",
|
|
61
|
+
"@whereby.com/eslint-config": "0.1.0",
|
|
61
62
|
"@whereby.com/jest-config": "0.1.0",
|
|
62
|
-
"@whereby.com/tsconfig": "0.1.0",
|
|
63
63
|
"@whereby.com/prettier-config": "0.1.0",
|
|
64
64
|
"@whereby.com/rollup-config": "0.1.0",
|
|
65
|
-
"@whereby.com/
|
|
65
|
+
"@whereby.com/tsconfig": "0.1.0"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@reduxjs/toolkit": "^2.2.3",
|
|
69
|
-
"@whereby.com/media": "2.1.
|
|
69
|
+
"@whereby.com/media": "2.1.5",
|
|
70
70
|
"axios": "^1.11.0",
|
|
71
71
|
"btoa": "^1.2.1",
|
|
72
72
|
"events": "^3.3.0"
|