@cloudflare/realtimekit 0.0.2 → 0.5.0-staging.42

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.
@@ -0,0 +1,17 @@
1
+ import { Project, SyntaxKind } from "ts-morph";
2
+ import fs from "fs";
3
+
4
+ const project = new Project();
5
+ const sourceFiles = project.addSourceFilesAtPaths("dist/**/*.d.ts");
6
+
7
+ for (const file of sourceFiles) {
8
+ file.forEachDescendant((node) => {
9
+ if (node.getText().includes("DyteClient")) {
10
+ node.replaceWithText(node.getText().replace("DyteClient", "RealtimeKitClient"));
11
+ } else if (node.getText().includes("Dyte")) {
12
+ node.replaceWithText(node.getText().replace("Dyte", "RTK"));
13
+ }
14
+ });
15
+ }
16
+
17
+ project.saveSync();
package/LICENSE.txt ADDED
@@ -0,0 +1 @@
1
+ # LICENSE
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ <!-- PROJECT LOGO -->
2
+ <p align="center">
3
+ <a href="https://cloudflare.com">
4
+ <img src="https://cf-assets.www.cloudflare.com/slt3lc6tev37/6EYsdkdfBcHtgPmgp3YtkD/0b203affd2053988264b9253b13de6b3/logo-thumbnail.png" alt="Logo" width="80">
5
+ </a>
6
+ <h3 align="center">RealtimeKit</h3>
7
+
8
+ <p align="center">
9
+ A real-time video and audio SDK for building custom, collaborative communication experiences.
10
+ <br />
11
+ <a href="https://docs.realtime.cloudflare.com"><strong>Explore the docs »</strong></a>
12
+ <br />
13
+ <br />
14
+ <a href="https://demo.realtime.cloudflare.com">View Demo</a>
15
+ ·
16
+ <a href="https://community.cloudflare.com/">Report Bug</a>
17
+ ·
18
+ <a href="https://community.cloudflare.com/">Request Feature</a>
19
+ </p>
20
+ </p>
21
+
22
+
23
+
24
+ <!-- TABLE OF CONTENTS -->
25
+
26
+ ## Table of Contents
27
+
28
+ * [About the Project](#about-the-project)
29
+ * [Built With](#built-with)
30
+ * [Installation](#installation)
31
+ * [Usage](#usage)
32
+ * [About](#about)
33
+
34
+
35
+
36
+ <!-- ABOUT THE PROJECT -->
37
+ ## About The Project
38
+
39
+ A real-time video and audio SDK for building custom, collaborative communication experiences.
40
+
41
+ ### Built With
42
+
43
+ * [Cloudflare](https://cloudflare.com)
44
+ * [Typescript](https://typescriptlang.org)
45
+
46
+
47
+ <!-- INSTALLATION -->
48
+ ## Installation
49
+
50
+ ```sh
51
+ npm install realtimekit-web
52
+ ```
53
+
54
+
55
+
56
+ <!-- USAGE EXAMPLES -->
57
+ ## Usage
58
+
59
+ A `meeting` object can be created using the `RealtimeKit.init()` method.
60
+
61
+ ```ts
62
+ const meeting = await RealtimeKit.init({
63
+ authToken: "<AuthTokenHere>",
64
+ defaults: {
65
+ audio: false,
66
+ video: false,
67
+ }
68
+ });
69
+ ```
70
+
71
+ The `meeting` object is used for all interaction with Cloudflare's servers. For example, the following code snippet is used for a user to join a room.
72
+
73
+ ```ts
74
+ await meeting.join();
75
+ ```
76
+
77
+ _For more examples, please refer to the [Documentation](https://docs.realtime.cloudflare.com)._
78
+
79
+ ## About
80
+
81
+ `realtimekit-web` is created & maintained by Cloudflare, Inc.
82
+
83
+ The names and logos are trademarks of Cloudflare, Inc.
84
+
package/build-types.sh ADDED
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+
3
+ # Exit bash script if any of the commands fails
4
+ set -e
5
+ # Back up the original package.json
6
+ cp package.json package.json.bak
7
+
8
+ # Remove all dependencies starting with the prefix @dyte-in
9
+ # The imported types from these dependencies will be bundled
10
+ cat package.json.bak | jq '.dependencies |= delpaths([keys[] | select(contains("@dytesdk")) | [.]])' > package.json
11
+
12
+ function restore {
13
+ echo "Restoring package.json"
14
+ mv package.json.bak package.json
15
+ }
16
+
17
+ # Always run the restore function on exit
18
+ trap restore EXIT
19
+
20
+ npx tsup src/index.ts --external @protobuf-ts/runtime,worker-timers,bowser,lodash-es,sdp-transform --dts-resolve --dts-only --format esm
21
+ npx tsup src/react.ts --external @protobuf-ts/runtime,worker-timers,bowser,lodash-es,sdp-transform --dts-resolve --dts-only --format esm