├── .dockerignore
├── .github
├── release-drafter.yml
└── workflows
│ ├── ci.yaml
│ └── release-please.yml
├── .gitignore
├── .gitmodules
├── .npmrc
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── client-web
├── .gitignore
├── index.html
├── package.json
├── proto
│ └── sfu.proto
├── public
│ └── vite.svg
├── src
│ ├── component.ts
│ ├── index.ts
│ ├── lib
│ │ ├── core.ts
│ │ ├── index.ts
│ │ └── sfu.ts
│ └── vite-env.d.ts
├── tsconfig.json
└── vite.config.ts
├── demo-cdn
├── README.md
├── index.html
├── main.js
└── package.json
├── demo-react
├── .gitignore
├── README.md
├── eslint.config.js
├── functions
│ └── auth.ts
├── index.html
├── package.json
├── public
│ └── vite.svg
├── src
│ ├── App.tsx
│ ├── main.tsx
│ ├── util.ts
│ └── vite-env.d.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── wrangler.toml
├── demo-server
├── README.md
├── index.d.ts
├── index.js
└── package.json
├── package-lock.json
├── package.json
├── peer
├── .gitignore
├── CONTRIBUTING.md
├── Makefile
├── README.md
├── bump.bash
├── generate.bash
├── index.html
├── jsr.json
├── main.ts
├── package.json
├── scripts
│ └── patch.cjs
├── src
│ ├── analytics.ts
│ ├── index.ts
│ ├── logger.test.ts
│ ├── logger.ts
│ ├── peer.ts
│ ├── session.ts
│ ├── signaling.client.ts
│ ├── signaling.ts
│ ├── store.ts
│ ├── transport.ts
│ ├── util.ts
│ └── vite-env.d.ts
├── tsconfig.json
├── vite.config.ts
└── vitest.config.ts
├── playwright.config.ts
└── tests
└── demo-react.spec.ts
/.dockerignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.github/release-drafter.yml:
--------------------------------------------------------------------------------
1 | template: |
2 | ## What’s Changed
3 |
4 | $CHANGES
5 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches: ['main']
6 | tags:
7 | - "v*"
8 | pull_request:
9 | branches: ['main']
10 |
11 | schedule:
12 | - cron: "0 * * * *"
13 |
14 | workflow_dispatch:
15 | inputs:
16 | tag:
17 | description: 'Tag to release (e.g., v1.2.3)'
18 | required: false
19 | default: ''
20 |
21 | env:
22 | REGISTRY: ghcr.io
23 | IMAGE_NAME: ${{ github.repository }}
24 |
25 | jobs:
26 | test:
27 | timeout-minutes: 60
28 | runs-on: ubuntu-24.04
29 | steps:
30 | - uses: actions/checkout@v4
31 | with:
32 | ref: ${{ github.event.inputs.tag || github.ref }}
33 | - uses: actions/setup-node@v4
34 | with:
35 | node-version: lts/*
36 | - name: Install dependencies
37 | run: npm ci
38 | - name: Install Playwright Browsers
39 | run: npx playwright install --with-deps
40 | - name: Run tests
41 | run: make test
42 | env:
43 | PULSEBEAM_API_KEY: ${{ secrets.PULSEBEAM_API_KEY }}
44 | PULSEBEAM_API_SECRET: ${{ secrets.PULSEBEAM_API_SECRET }}
45 | - uses: actions/upload-artifact@v4
46 | if: ${{ !cancelled() }}
47 | with:
48 | name: playwright-report
49 | path: playwright-report/
50 | retention-days: 1
51 | - name: Notify Discord on Failure
52 | if: failure()
53 | uses: appleboy/discord-action@v1.2.0
54 | with:
55 | webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
56 | color: "FF0000" # Red color for failure
57 | title: "GitHub Action Failed"
58 | message: |
59 | Workflow: ${{ github.workflow }}
60 | Job: ${{ github.job }}
61 | Run ID: ${{ github.run_id }}
62 | Repository: ${{ github.repository }}
63 | Branch: ${{ github.ref }}
64 | Commit: ${{ github.sha }}
65 | Error URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
66 |
67 | release_peer:
68 | if: ${{ github.event.inputs.tag != '' || startsWith(github.ref, 'refs/tags/v') }}
69 | runs-on: ubuntu-24.04
70 | needs: ['test']
71 | permissions:
72 | contents: write
73 | id-token: write # The OIDC ID token is used for authentication with JSR.
74 | steps:
75 | - name: Checkout
76 | uses: actions/checkout@v4
77 | with:
78 | ref: ${{ github.event.inputs.tag || github.ref }}
79 | - uses: actions/setup-node@v4
80 | with:
81 | node-version: '20.x'
82 | registry-url: 'https://registry.npmjs.org'
83 | - name: Set version env
84 | run: echo "RELEASE_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
85 | - uses: release-drafter/release-drafter@v5
86 | with:
87 | name: ${{ env.RELEASE_VERSION }}
88 | tag: ${{ env.RELEASE_VERSION }}
89 | version: ${{ env.RELEASE_VERSION }}
90 | publish: true
91 | template: |
92 | ## What’s Changed
93 |
94 | $CHANGES
95 | env:
96 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 | - run: npm ci
98 | - working-directory: ./peer
99 | run: |
100 | npx jsr publish --allow-slow-types
101 | npm run build
102 | npm publish --provenance --access public
103 | env:
104 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
105 |
106 | publish_e2e_docker:
107 | runs-on: ubuntu-24.04
108 | if: false
109 | permissions:
110 | contents: read
111 | packages: write
112 | attestations: write
113 | id-token: write
114 | steps:
115 | - name: Checkout repository
116 | uses: actions/checkout@v4
117 | with:
118 | ref: ${{ github.event.inputs.tag || github.ref }}
119 | # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
120 | - name: Log in to the Container registry
121 | uses: docker/login-action@v3
122 | with:
123 | registry: ${{ env.REGISTRY }}
124 | username: ${{ github.actor }}
125 | password: ${{ secrets.GITHUB_TOKEN }}
126 | -
127 | name: Set up QEMU
128 | uses: docker/setup-qemu-action@v3
129 | -
130 | name: Set up Docker Buildx
131 | uses: docker/setup-buildx-action@v3
132 | # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
133 | - name: Extract metadata (tags, labels) for Docker
134 | id: meta
135 | uses: docker/metadata-action@v5
136 | with:
137 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
138 | # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
139 | # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
140 | # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
141 | - name: Build and push Docker image
142 | id: push
143 | uses: docker/build-push-action@v6
144 | with:
145 | context: .
146 | push: true
147 | tags: ${{ steps.meta.outputs.tags }}
148 | labels: ${{ steps.meta.outputs.labels }}
149 | # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
150 | - name: Generate artifact attestation
151 | uses: actions/attest-build-provenance@v2
152 | with:
153 | subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
154 | subject-digest: ${{ steps.push.outputs.digest }}
155 | push-to-registry: true
156 |
--------------------------------------------------------------------------------
/.github/workflows/release-please.yml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | branches:
4 | - main
5 |
6 | permissions:
7 | contents: write
8 | pull-requests: write
9 |
10 | name: release-please
11 |
12 | jobs:
13 | release-please:
14 | if: false
15 | runs-on: ubuntu-latest
16 | steps:
17 | - uses: googleapis/release-please-action@v4
18 | with:
19 | # this is a built-in strategy in release-please, see "Action Inputs"
20 | # for more options
21 | release-type: simple
22 | token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .parcel-cache
3 | /test-results/
4 | /playwright-report/
5 | /blob-report/
6 | /playwright/.cache/
7 | .DS_Store
8 | .vscode
9 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "peer/proto"]
2 | path = peer/proto
3 | url = git@github.com:PulseBeamDev/pulsebeam-proto.git
4 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | @jsr:registry=https://npm.jsr.io
2 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/playwright:v1.49.1-noble
2 |
3 | WORKDIR /app
4 | RUN apt update && apt install -y make
5 | COPY . .
6 | RUN make install
7 | ENTRYPOINT ["make", "e2e"]
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: e2e
2 |
3 | ci:
4 | npm ci
5 |
6 | bump:
7 | $(MAKE) -C peer bump VERSION=$(VERSION)
8 |
9 | publish:
10 | $(MAKE) -C peer publish
11 |
12 | install:
13 | npm install
14 | npx playwright install-deps
15 | npx playwright install
16 |
17 | test:
18 | $(MAKE) -C peer test
19 | npm run build -w peer
20 | npx playwright test --project=local -j 1
21 |
22 | test-local:
23 | PULSEBEAM_BASE_URL=http://localhost:3000 npx playwright test --project=local -j 2
24 |
25 | test-flaky:
26 | for i in `seq 100`; do echo $i; make test-local || break; done
27 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # @pulsebeam/client
2 |
3 | Simplifies real-time application development. Defines signaling protocol for connection establishment, handling media and data transmission, and provides infrastructure.
4 |
5 | ## Status
6 |
7 | > [!WARNING]
8 | > This SDK is currently in active development. We're currently brewing a homegrown WebRTC SFU implementation in Rust, https://github.com/pulseBeamDev/pulsebeam.
9 | >
10 | > • [Create GitHub Issues](https://github.com/PulseBeamDev/pulsebeam-js/issues)
11 | > • [Join PulseBeam Developer Discord](https://discord.gg/Bhd3t9afuB)
12 |
13 | ## Roadmap
14 |
15 | The project is in active development, please refer to the [roadmap](https://github.com/PulseBeamDev/pulsebeam-js/issues/6) to track our major milestones.
16 |
17 | ## Semantic Versioning
18 |
19 | This project adheres to [Semantic Versioning 2.0.0](https://semver.org/).
20 |
21 | * **MAJOR version (X.y.z):** Incompatible API changes.
22 | * **MINOR version (x.Y.z):** Functionality added in a backwards compatible manner.
23 | * **PATCH version (x.y.Z):** Backwards compatible bug fixes.
24 |
25 | ## WebRTC Resources
26 |
27 | For a deeper understanding of WebRTC concepts, consult the official WebRTC documentation:
28 |
29 | * https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
30 |
31 | ## Related Links
32 |
33 | |Name|Link|
34 | |-|-|
35 | |PulseBeam Server|github.com/pulseBeamDev/pulsebeam|
36 | |Client SDK|https://github.com/PulseBeamDev/pulsebeam-js|
37 | |Server SDK|https://github.com/PulseBeamDev/pulsebeam-core|
38 | |FOSS Server|https://github.com/PulseBeamDev/pulsebeam-server-foss|
39 | |Signaling Protocol|https://github.com/PulseBeamDev/pulsebeam-proto|
40 | |Documentation|https://github.com/PulseBeamDev/docs|
41 | |PulseBeam Cloud|https://cloud.pulsebeam.dev|
42 |
43 |
--------------------------------------------------------------------------------
/client-web/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/client-web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Vite + Lit + TS
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/client-web/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "client-web",
3 | "private": true,
4 | "version": "0.0.0",
5 | "type": "module",
6 | "main": "./dist/pulsebeam.umd.cjs",
7 | "module": "./dist/pulsebeam.es.js",
8 | "types": "./dist/types/index.d.ts",
9 | "exports": {
10 | ".": {
11 | "require": {
12 | "types": "./dist/types/index.d.ts",
13 | "default": "./dist/pulsebeam.es.js"
14 | },
15 | "default": {
16 | "types": "./dist/types/index.d.ts",
17 | "default": "./dist/pulsebeam.umd.js"
18 | }
19 | }
20 | },
21 | "scripts": {
22 | "proto": "protoc --ts_out src/lib --proto_path proto proto/sfu.proto",
23 | "dev": "vite",
24 | "build": "tsc && vite build",
25 | "preview": "vite preview"
26 | },
27 | "dependencies": {
28 | "@lit/context": "^1.1.5",
29 | "@protobuf-ts/runtime": "^2.10.0",
30 | "lit": "^3.3.0",
31 | "nanostores": "^1.0.1"
32 | },
33 | "devDependencies": {
34 | "@protobuf-ts/plugin": "^2.10.0",
35 | "typescript": "~5.8.3",
36 | "vite": "^6.3.5",
37 | "vite-plugin-dts": "^4.5.4"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/client-web/proto/sfu.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 | package sfu;
3 |
4 | // -------------------------------------
5 | // Common Types
6 | // -------------------------------------
7 |
8 | // Media configuration for a participant's stream
9 | message MediaConfig {
10 | bool audio = 1; // True if audio is active
11 | bool video = 2; // True if video is active
12 | }
13 |
14 | // Video quality preferences
15 | message VideoSettings {
16 | int32 max_height = 1; // Maximum height for the video stream
17 | }
18 |
19 | // State of a participant's stream
20 | message ParticipantStream {
21 | string participant_id = 1; // Unique SFU-internal ID
22 | string external_participant_id = 2; // Developer-provided user ID
23 | optional MediaConfig media = 3; // Media state (if unset, participant has left)
24 | }
25 |
26 | // -------------------------------------
27 | // Client → Server
28 | // -------------------------------------
29 |
30 | // Client message wrapper with sequence number for reliability
31 | message ClientMessage {
32 | uint32 sequence = 1; // Sequence number for message ordering/acknowledgment
33 | oneof msg {
34 | PublishIntent publish_intent = 2;
35 | VideoSubscription video_subscription = 3;
36 | }
37 | }
38 |
39 | // Intent to publish media
40 | message PublishIntent {
41 | MediaConfig media = 1; // Media to publish (audio/video)
42 | }
43 |
44 | // Subscriptions for receiving media from specific participants
45 | message VideoSubscription {
46 | repeated ParticipantSubscription subscriptions = 1;
47 | }
48 |
49 | // Subscription for a specific participant's video
50 | message ParticipantSubscription {
51 | string participant_id = 1;
52 | VideoSettings video_settings = 2;
53 | }
54 |
55 | // -------------------------------------
56 | // Server → Client
57 | // -------------------------------------
58 |
59 | // Server message wrapper
60 | message ServerMessage {
61 | oneof msg {
62 | RoomSnapshot room_snapshot = 1;
63 | StreamStateUpdate stream_update = 2;
64 | ActiveSpeakersUpdate active_speakers = 3;
65 | MessageAck message_ack = 4;
66 | ConnectionQuality connection_quality = 5;
67 | ErrorNotification error = 6;
68 | }
69 | }
70 |
71 | // Full snapshot of the room state
72 | message RoomSnapshot {
73 | repeated ParticipantStream participants = 1;
74 | string room_id = 2; // Room identifier for verification
75 | }
76 |
77 | // Incremental update of a participant's stream
78 | message StreamStateUpdate {
79 | ParticipantStream participant_stream = 1;
80 | }
81 |
82 | // Current active speakers in the room
83 | message ActiveSpeakersUpdate {
84 | repeated string participant_ids = 1; // Ordered by speaking activity (most active first)
85 | uint64 timestamp = 2; // Server timestamp for this update
86 | }
87 |
88 | // Connection quality metrics for adaptive streaming
89 | message ConnectionQuality {
90 | string participant_id = 1; // Which participant this applies to (empty = self)
91 | Quality quality = 2; // Connection quality level
92 | optional uint32 rtt_ms = 3; // Round-trip time in milliseconds
93 | }
94 |
95 | // Message acknowledgment (only for client message processing)
96 | message MessageAck {
97 | uint32 sequence = 1; // Sequence number being acknowledged
98 | bool success = 2; // Whether the message was processed successfully
99 | optional string message = 3; // Error details if success is false
100 | }
101 |
102 | // Server-initiated error notification
103 | message ErrorNotification {
104 | ErrorType type = 1; // Type of error
105 | string message = 2; // Human-readable error message
106 | bool fatal = 3; // Whether client should disconnect
107 | }
108 |
109 | // Connection quality levels
110 | enum Quality {
111 | EXCELLENT = 0;
112 | GOOD = 1;
113 | FAIR = 2;
114 | POOR = 3;
115 | DISCONNECTED = 4;
116 | }
117 |
118 | // Server-initiated error types
119 | enum ErrorType {
120 | ROOM_CLOSED = 0; // Room was closed by moderator/system
121 | PARTICIPANT_KICKED = 1; // Participant was removed from room
122 | SERVER_SHUTDOWN = 2; // Server is shutting down
123 | ROOM_CAPACITY_CHANGED = 3; // Room capacity reduced, participant removed
124 | AUTHENTICATION_EXPIRED = 4; // Auth token expired
125 | DUPLICATE_CONNECTION = 5; // Same participant connected elsewhere
126 | PROTOCOL_VIOLATION = 6; // Client sent malformed/invalid messages
127 | UNKNOWN_ERROR = 7;
128 | }
129 |
130 |
--------------------------------------------------------------------------------
/client-web/public/vite.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client-web/src/component.ts:
--------------------------------------------------------------------------------
1 | import { html, LitElement } from "lit";
2 | import { customElement, property, query } from "lit/decorators.js";
3 | import { consume, createContext, provide } from "@lit/context";
4 | import { ClientCore } from "./lib";
5 | import type { ParticipantMeta } from "./lib/core";
6 |
7 | const clientContext = createContext(Symbol("client"));
8 |
9 | @customElement("pulsebeam-context")
10 | export class PulsebeamContext extends LitElement {
11 | @provide({ context: clientContext })
12 | @property({ attribute: false })
13 | value!: ClientCore;
14 |
15 | @query("slot")
16 | slotEl!: HTMLSlotElement;
17 |
18 | private audioElements: HTMLAudioElement[] = [];
19 |
20 | firstUpdated() {
21 | this.audioElements = Array.from(this.renderRoot.querySelectorAll("audio"));
22 | console.log("Audio elements:", this.audioElements);
23 | }
24 |
25 | render() {
26 | return html`
27 |
28 |
29 |
30 |
31 |
32 | `;
33 | }
34 | }
35 |
36 | @customElement("pulsebeam-video")
37 | export class PulsebeamVideo extends LitElement {
38 | @property({ attribute: false })
39 | participantMeta?: ParticipantMeta;
40 |
41 | @consume({ context: clientContext, subscribe: true })
42 | client?: ClientCore;
43 |
44 | @query("video")
45 | videoEl!: HTMLVideoElement;
46 |
47 | firstUpdated() {
48 | if (!this.client) {
49 | console.warn("No client context available");
50 | return;
51 | }
52 |
53 | if (!this.participantMeta) {
54 | console.warn("No participant specified on ");
55 | return;
56 | }
57 |
58 | this.client.subscribeVideo(this.videoEl, this.participantMeta);
59 | }
60 |
61 | render() {
62 | return html``;
63 | }
64 | }
65 |
66 | declare global {
67 | interface HTMLElementTagNameMap {
68 | "pulsebeam-context": PulsebeamContext;
69 | "pulsebeam-video": PulsebeamVideo;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/client-web/src/index.ts:
--------------------------------------------------------------------------------
1 | import type { PulsebeamVideo } from "./component";
2 | import { ClientCore } from "./lib";
3 | export * from "./component";
4 |
5 | const context = document.querySelector("pulsebeam-context");
6 |
7 | (async () => {
8 | const client = new ClientCore({
9 | sfuUrl: "http://localhost:3000/",
10 | maxDownstreams: 1,
11 | });
12 | context!.value = client;
13 |
14 | const videos: Record = {};
15 | client.$state.listen((v) => console.log(v));
16 | client.$participants.listen(async (newValue, _, changed) => {
17 | // Create a new pulsebeam-video element if not already present
18 | let video = videos[changed];
19 | if (video) {
20 | return;
21 | }
22 |
23 | video = document.createElement("pulsebeam-video") as PulsebeamVideo;
24 | videos[changed] = video;
25 | await video.updateComplete;
26 |
27 | // Set participantMeta on the pulsebeam-video element
28 | const participantMeta = newValue[changed].get(); // Get the metadata for the participant
29 | video.participantMeta = participantMeta;
30 | console.log(participantMeta);
31 |
32 | // Append the video to the DOM
33 | context!.appendChild(video);
34 | });
35 | await client.connect("default", `alice-${Math.round(Math.random() * 100)}`);
36 |
37 | const stream = await navigator.mediaDevices.getUserMedia({
38 | video: true,
39 | });
40 |
41 | client.publish(stream);
42 | })();
43 |
--------------------------------------------------------------------------------
/client-web/src/lib/core.ts:
--------------------------------------------------------------------------------
1 | import {
2 | ClientMessage,
3 | MediaConfig,
4 | ParticipantStream,
5 | ParticipantSubscription,
6 | ServerMessage,
7 | } from "./sfu.ts";
8 | import {
9 | atom,
10 | map,
11 | type PreinitializedMapStore,
12 | type PreinitializedWritableAtom,
13 | } from "nanostores";
14 |
15 | const MAX_DOWNSTREAMS = 16;
16 | const LAST_N_AUDIO = 3;
17 | const DEBOUNCE_DELAY_MS = 500;
18 |
19 | // Internal Ids
20 | type ParticipantId = string;
21 |
22 | interface VideoSlot {
23 | trans: RTCRtpTransceiver;
24 | participantId?: ParticipantId;
25 | }
26 |
27 | export interface ParticipantMeta {
28 | externalParticipantId: string;
29 | participantId: string;
30 | media: MediaConfig;
31 | stream: MediaStream;
32 | maxHeight: number;
33 | }
34 |
35 | export interface ClientCoreConfig {
36 | sfuUrl: string;
37 | maxDownstreams: number;
38 | }
39 |
40 | export class ClientCore {
41 | #sfuUrl: string;
42 | #pc: RTCPeerConnection;
43 | #rpc: RTCDataChannel;
44 | #videoSender: RTCRtpTransceiver;
45 | #audioSender: RTCRtpTransceiver;
46 | #closed: boolean;
47 | #sequence: number;
48 |
49 | #videoSlots: VideoSlot[];
50 | #audioSlots: RTCRtpTransceiver[];
51 | #timeoutId: ReturnType | null;
52 |
53 | $participants: PreinitializedMapStore<
54 | Record>
55 | >;
56 | $state: PreinitializedWritableAtom;
57 |
58 | constructor(cfg: ClientCoreConfig) {
59 | this.#sfuUrl = cfg.sfuUrl;
60 | const maxDownstreams = Math.max(
61 | Math.min(cfg.maxDownstreams, MAX_DOWNSTREAMS),
62 | 0,
63 | );
64 | this.#closed = false;
65 | this.#videoSlots = [];
66 | this.#audioSlots = [];
67 | this.#sequence = 0;
68 | this.#timeoutId = null;
69 | this.$participants = map({});
70 | this.$state = atom("new");
71 |
72 | this.#pc = new RTCPeerConnection();
73 | this.#pc.onconnectionstatechange = () => {
74 | const connectionState = this.#pc.connectionState;
75 | console.debug(`PeerConnection state changed: ${connectionState}`);
76 | this.$state.set(connectionState);
77 | if (
78 | connectionState === "failed" || connectionState === "closed" ||
79 | connectionState === "disconnected"
80 | ) {
81 | this.#close(
82 | `PeerConnection state became: ${connectionState}`,
83 | );
84 | }
85 | };
86 |
87 | // SFU RPC DataChannel
88 | this.#rpc = this.#pc.createDataChannel("pulsebeam::rpc");
89 | this.#rpc.binaryType = "arraybuffer";
90 | this.#rpc.onmessage = (event: MessageEvent) => {
91 | try {
92 | const serverMessage = ServerMessage.fromBinary(
93 | new Uint8Array(event.data as ArrayBuffer),
94 | );
95 | const msg = serverMessage.msg;
96 | const msgKind = msg.oneofKind;
97 | if (!msgKind) {
98 | console.warn("Received SFU message with undefined payload kind.");
99 | return;
100 | }
101 |
102 | switch (msgKind) {
103 | case "roomSnapshot":
104 | this.#handleParticipantUpdates(msg.roomSnapshot.participants);
105 | break;
106 | case "streamUpdate":
107 | if (msg.streamUpdate.participantStream) {
108 | this.#handleParticipantUpdates([
109 | msg.streamUpdate.participantStream,
110 | ]);
111 | }
112 | break;
113 | }
114 | // TODO: implement this
115 | } catch (e: any) {
116 | this.#close(`Error processing SFU RPC message: ${e}`);
117 | }
118 | };
119 | this.#rpc.onclose = () => {
120 | this.#close("Internal RPC closed prematurely");
121 | };
122 | this.#rpc.onerror = (e) => {
123 | this.#close(`Internal RPC closed prematurely with an error: ${e}`);
124 | };
125 |
126 | // Transceivers
127 | this.#videoSender = this.#pc.addTransceiver("video", {
128 | direction: "sendonly",
129 | });
130 | this.#audioSender = this.#pc.addTransceiver("audio", {
131 | direction: "sendonly",
132 | });
133 |
134 | for (let i = 0; i < LAST_N_AUDIO; i++) {
135 | this.#pc.addTransceiver("audio", {
136 | direction: "recvonly",
137 | });
138 | }
139 |
140 | for (let i = 0; i < maxDownstreams; i++) {
141 | this.#pc.addTransceiver("video", {
142 | direction: "recvonly",
143 | });
144 | }
145 | }
146 |
147 | #sendRpc(msg: ClientMessage["msg"]) {
148 | this.#rpc.send(ClientMessage.toBinary({
149 | sequence: this.#sequence,
150 | msg,
151 | }));
152 | this.#sequence += 1;
153 | }
154 |
155 | #handleParticipantUpdates(streams: ParticipantStream[]) {
156 | const newParticipants: ParticipantMeta[] = [];
157 |
158 | for (const stream of streams) {
159 | if (!stream.media) {
160 | // participant has left
161 | this.$participants.setKey(stream.participantId, undefined);
162 | continue;
163 | }
164 |
165 | if (stream.participantId in this.$participants.get()) {
166 | const participant = this.$participants.get()[stream.participantId];
167 | participant.setKey("media", stream.media);
168 | participant.setKey(
169 | "externalParticipantId",
170 | stream.externalParticipantId,
171 | );
172 | participant.setKey("participantId", stream.participantId);
173 | } else {
174 | const meta: ParticipantMeta = {
175 | externalParticipantId: stream.externalParticipantId,
176 | participantId: stream.participantId,
177 | media: stream.media,
178 | stream: new MediaStream(),
179 | maxHeight: 0, // default invisible until the UI tells us to render
180 | };
181 |
182 | const reactiveMeta = atom(meta);
183 | reactiveMeta.listen((_) => {
184 | this.#triggerSubscriptionFeedback();
185 | });
186 | this.$participants.setKey(stream.participantId, atom(meta));
187 | newParticipants.push(meta);
188 | }
189 | }
190 |
191 | // TODO: should we bin pack the old participants first?
192 | for (const slot of this.#videoSlots) {
193 | if (slot.participantId) {
194 | if (slot.participantId in this.$participants) {
195 | continue;
196 | }
197 |
198 | slot.participantId = undefined;
199 | }
200 |
201 | const participant = newParticipants.pop();
202 | if (!participant) {
203 | continue;
204 | }
205 |
206 | slot.participantId = participant.participantId;
207 | }
208 |
209 | this.#triggerSubscriptionFeedback();
210 | }
211 |
212 | #close(error?: string) {
213 | if (this.#closed) return;
214 |
215 | if (error) {
216 | console.error("exited with an error:", error);
217 | }
218 |
219 | this.#closed = true;
220 | }
221 |
222 | #triggerSubscriptionFeedback() {
223 | if (this.#timeoutId) {
224 | return;
225 | }
226 |
227 | this.#timeoutId = setTimeout(() => {
228 | const subscriptions: ParticipantSubscription[] = Object.values(
229 | this.$participants,
230 | ).map((p) => ({
231 | participantId: p.participantId,
232 | videoSettings: {
233 | maxHeight: p.maxHeight,
234 | },
235 | }));
236 | this.#sendRpc({
237 | oneofKind: "videoSubscription",
238 | videoSubscription: {
239 | subscriptions,
240 | },
241 | });
242 | }, DEBOUNCE_DELAY_MS);
243 | }
244 |
245 | async connect(room: string, participant: string) {
246 | if (this.#closed) {
247 | const errorMessage =
248 | "This client instance has been terminated and cannot be reused.";
249 | console.error(errorMessage);
250 | throw new Error(errorMessage); // More direct feedback to developer
251 | }
252 |
253 | if (this.#pc.connectionState != "new") {
254 | const errorMessage =
255 | "This client instance has been initiated and cannot be reused.";
256 | console.error(errorMessage);
257 | throw new Error(errorMessage); // More direct feedback to developer
258 | }
259 |
260 | try {
261 | const offer = await this.#pc.createOffer();
262 | await this.#pc.setLocalDescription(offer);
263 | const response = await fetch(
264 | `${this.#sfuUrl}?room=${room}&participant=${participant}`,
265 | {
266 | method: "POST",
267 | body: offer.sdp!,
268 | headers: { "Content-Type": "application/sdp" },
269 | },
270 | );
271 | if (!response.ok) {
272 | throw new Error(
273 | `Signaling request failed: ${response.status} ${await response
274 | .text()}`,
275 | );
276 | }
277 | await this.#pc.setRemoteDescription({
278 | type: "answer",
279 | sdp: await response.text(),
280 | });
281 |
282 | // https://blog.mozilla.org/webrtc/rtcrtptransceiver-explored/
283 | // transceivers order is stable, and mid is only defined after setLocalDescription
284 | const transceivers = this.#pc.getTransceivers();
285 | for (const trans of transceivers) {
286 | if (trans.direction === "sendonly") {
287 | continue;
288 | }
289 |
290 | if (trans.receiver.track.kind === "audio") {
291 | this.#audioSlots.push(trans);
292 | } else if (trans.receiver.track.kind === "video") {
293 | this.#videoSlots.push({
294 | trans,
295 | });
296 | }
297 | }
298 |
299 | // Status transitions to "connected" will be handled by onconnectionstatechange
300 | } catch (error: any) {
301 | this.#close(
302 | error.message || "Signaling process failed unexpectedly.",
303 | );
304 | }
305 | }
306 |
307 | disconnect() {
308 | if (this.#timeoutId) {
309 | clearTimeout(this.#timeoutId);
310 | }
311 | this.#pc.close();
312 | }
313 |
314 | publish(stream: MediaStream) {
315 | const videoTracks = stream.getVideoTracks();
316 | if (videoTracks.length > 1) {
317 | throw new Error(
318 | `Unexpected MediaStream composition: Expected at most one video track, but found ${videoTracks.length}. This component or function is designed to handle a single video source and/or a single audio source.`,
319 | );
320 | }
321 |
322 | const audioTracks = stream.getAudioTracks();
323 | if (audioTracks.length > 1) {
324 | throw new Error(
325 | `Unexpected MediaStream composition: Expected at most one audio track, but found ${audioTracks.length}. This component or function is designed to handle a single audio source and/or a single audio source.`,
326 | );
327 | }
328 |
329 | const newVideoTrack = videoTracks.at(0) || null;
330 | this.#videoSender.sender.replaceTrack(newVideoTrack);
331 |
332 | const newAudioTrack = audioTracks.at(0) || null;
333 | this.#audioSender.sender.replaceTrack(newAudioTrack);
334 | }
335 |
336 | unpublish() {
337 | this.#videoSender.sender.replaceTrack(null);
338 | this.#audioSender.sender.replaceTrack(null);
339 | }
340 |
341 | // TODO: remove browser specific
342 | subscribeVideo(video: HTMLVideoElement, participant: ParticipantMeta) {
343 | video.srcObject = participant.stream;
344 | video.autoplay = true;
345 | }
346 |
347 | subscribeAudio(audio: HTMLAudioElement) {
348 | }
349 | }
350 |
--------------------------------------------------------------------------------
/client-web/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | export { ClientCore, type ClientCoreConfig } from "./core.ts";
2 |
--------------------------------------------------------------------------------
/client-web/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/client-web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "experimentalDecorators": true,
5 | "useDefineForClassFields": false,
6 | "module": "ESNext",
7 | "lib": [
8 | "ES2020",
9 | "DOM",
10 | "DOM.Iterable"
11 | ],
12 | "skipLibCheck": true,
13 | /* Bundler mode */
14 | "moduleResolution": "bundler",
15 | "allowImportingTsExtensions": true,
16 | "verbatimModuleSyntax": true,
17 | "moduleDetection": "force",
18 | "noEmit": true,
19 | /* Linting */
20 | "strict": true,
21 | "noUnusedLocals": true,
22 | "noUnusedParameters": true,
23 | "erasableSyntaxOnly": true,
24 | "noFallthroughCasesInSwitch": true,
25 | "noUncheckedSideEffectImports": true
26 | },
27 | "include": [
28 | "src"
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/client-web/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import path from "path";
3 | import dts from "vite-plugin-dts";
4 |
5 | export default defineConfig({
6 | plugins: [
7 | dts({
8 | insertTypesEntry: true,
9 | outDir: "dist/types",
10 | tsconfigPath: "./tsconfig.json",
11 | }),
12 | ],
13 | build: {
14 | // Output directory for the built library
15 | outDir: "dist",
16 | // Minify the output
17 | minify: true, // 'esbuild' or true for terser, false to disable
18 | // Generate source maps
19 | sourcemap: true,
20 | lib: {
21 | // The entry point for your library (exports all components)
22 | entry: path.resolve(__dirname, "src/index.ts"),
23 | // The name for the UMD build (if you're creating one)
24 | name: "Pulsebeam",
25 | // Output formats
26 | formats: ["es", "umd"],
27 | // Filename for the generated bundle (without extension)
28 | // The [format] placeholder will be replaced by 'es', 'cjs', or 'umd'
29 | fileName: (format) => `pulsebeam.${format}.js`,
30 | },
31 | // rollupOptions: {
32 | // // Make sure to externalize dependencies that shouldn't be bundled
33 | // // into your library (Lit itself should be a peer dependency)
34 | // external: ["lit", /^lit\/.*/],
35 | // output: {
36 | // // Provide global variables to use in the UMD build
37 | // // for externalized deps
38 | // globals: {
39 | // "lit": "Lit",
40 | // "lit/decorators.js": "LitDecorators", // Adjust if you import directly
41 | // "lit/html.js": "LitHtml", // Adjust
42 | // // Add other lit direct imports if you use them, e.g. 'lit/directives/class-map.js'
43 | // },
44 | // // If you want to export CSS separately (Less common for Lit components with Shadow DOM)
45 | // // assetFileNames: (assetInfo) => {
46 | // // if (assetInfo.name === 'style.css') return 'my-lit-library.css';
47 | // // return assetInfo.name;
48 | // // },
49 | // },
50 | // },
51 | },
52 | });
53 |
--------------------------------------------------------------------------------
/demo-cdn/README.md:
--------------------------------------------------------------------------------
1 | # PulseBeam WebRTC DataChannel Example
2 |
3 | ### Run Demo
4 | 1. Install dependencies with `npm i`
5 | 1. Run with `npm start`
6 | 1. Go to your browser open two tabs:
7 | - URL for first tab: `http://localhost:3000/?development=true&peerId=peer-29`
8 | - URL for second tab: `http://localhost:3000/?development=true`
9 | 1. On the second tab say `peer-29` in the first text box. Then click connect.
10 | 1. You can edit the text in the bottom text box. And see it synchronizing between the peers.
11 | 1. Note: This demo will work globally within the scope of your project-id (not just two tabs within the same browser!). So feel free to have the one peer on a different network or machine.
12 | 1. If desired, go to inspector, console to see logs on either tab
13 |
14 | ### So [what happened?](https://pulsebeam.dev/docs/getting-started/what-happened/)
15 |
16 | ### For more information, see [related docs](https://pulsebeam.dev/docs/getting-started/quick-start/)
17 |
18 | ### Unfamiliar terms? See [glossary](https://pulsebeam.dev/docs/concepts/terms/)
19 |
20 | ### When running our demos locally, PulseBeam convention states:
21 | * Demo will use the local `/auth` server defined here (in `../demo-server`)
22 | * Adding `development=true` as a URL parameter will use insecure [development auth](https://pulsebeam.dev/docs/getting-started/quick-start/)
23 |
24 | ### Our demos:
25 | * Data channel `demo-cdn`, our [quickstart demo](https://pulsebeam.dev/docs/getting-started/quick-start/)
26 | * Video `../demo-react`, our [video chat demo](https://meet.pulsebeam.dev/)
27 |
28 | ### For questions, [contact us](https://pulsebeam.dev/docs/community-and-support/support/)
--------------------------------------------------------------------------------
/demo-cdn/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | PulseBeam Demo - CDN
8 |
9 |
10 |
11 |
12 |
13 |
14 |