sinch-rtc
Version:
RTC JavaScript/Web SDK
104 lines (58 loc) • 2.65 kB
Markdown
# Sinch RTC SDK - JavaScript
## Setting Up the Development Environment
Build tools are installed using [Nix](https://nixos.org/download.html) package manager.
Before running any `make` commands, ensure your Nix environment is configured to use the correct channel for dependencies.
1. **Add the NixOS 25.05 channel**
Open your `.nix-channels` file (usually in your home directory) and add the following line:
```bash
https://nixos.org/channels/nixos-25.05 nixpkgs-25
```
2. **Update Nix channels**
Run the following commands to update your channels:
```bash
nix-channel --update
nix-channel --list
```
You should see something like:
```bash
nixpkgs-25 https://nixos.org/channels/nixos-25.05
```
You can now safely run `make` commands
To install a local devenv, run:
make devenv
In the root of this repository run:
make sync
This will
- Sync git submodules.
- Set up npm environment [https://www.npmjs.com/]
When the script finishes, it should be possible to run.
make serve
this will build the sdk and start a local http server on port 5050 if everything works you should be able to load [http://localhost:5050/reference-apps/javascript/samples/]
## Build and Test Sdk
### Build
make build
### Generate ocra api from ocra design
make ocra
### Build and start local http server
make serve
### Tests
make test
### Create the jssdk package
make dist
## E2E Smoke test
### Build Sdk for E2E smoke test
make bidiro
### Build and start local host for running test host app
make bidiro-serve
This will start a local webserver at port 1080 and a WebSocket proxy listening on port 3000. To run the test host app use <http://localhost:1080/sinch/{channel}/?sdk={sdk}>
{channel} is an identifier for the channel and can be any string. WebSocket message to this app should be sent to http://{host}:3000/bidiro/{channel}
{sdk} is the folder where the sdk is located. By defaulr {sdk} is "sdk" which is the folder where the local built (make bidiro) sdk is located.
### Running E2E Tests inside docker locally
`npm run e2e`
## Prerequisites
1. Make sure you have cloned the [E2E repository](https://gitlab.com/sinch/sinch-projects/voice/rtc-sdk-e2e-test) in your home directory
2. The JS sdk and E2E respository are in the same parent directory
3. Docker or [Docker Desktop](https://www.docker.com/products/docker-desktop/) is installed on your machine
4. Replace `localhost` with `bidirohost` for `sinch.device.1` and `sinch.device.1` in `parameters-js-v2.xml`.
### Design
For design document, see [design/README.md](design/README.md)