The Shig Web Client is the official and reliable frontend of the Shig Federative Service, making access simple and efficient.
Create a local runtime configuration first:
cp .env.example .envAdjust .env for your local Shig setup:
SHIG_API_PREFIX=/api
SHIG_RELAY_SERVICE=http://relay.example.comThen install dependencies and start the development server:
npm install
npm startNavigate to http://localhost:4200/.
The web client is a static Angular application and is commonly served by Nginx. Because the browser cannot read server-side environment variables directly, this project generates a runtime config file:
.env -> src/assets/env.js
npm start and npm run build automatically run:
npm run generate-envThis creates src/assets/env.js, which is loaded by src/index.html before Angular starts.
Open-source users usually only need to change these values:
| Variable | Default | Description |
|---|---|---|
SHIG_API_PREFIX |
/api |
Base path or URL for the Shig REST API. Use /api when Nginx proxies API requests to the Shig backend. |
SHIG_RELAY_SERVICE |
http://localhost:4443/live |
URL for MoQ relay default service. |
For local development against a local Shig backend, a typical .env is:
SHIG_API_PREFIX=/api
SHIG_RELAY_SERVICE=http://localhost:4443/liveFor a setup where services are exposed on explicit URLs, use:
SHIG_API_PREFIX=https://web.example.org/api
SHIG_RELAY_SERVICE=https://relay.example.org/liveDo not commit .env; it is intentionally ignored. Commit .env.example when the documented defaults change.
For production you can either generate src/assets/env.js during the build, or replace assets/env.js when the container starts.
The generated file looks like this:
window.__SHIG_CONFIG__ = {
apiPrefix: "/api",
relayService: "https://relay.example.org"
};This lets the same static Angular build run in different environments by changing only assets/env.js.
The web client essentially serves as a frontend for a Shig instance; therefore, it requires one.
Please clone and run the Shig service project. https://github.com/shigde/shig
Now you can launch the Shig Web Client.
git clone https://github.com/shigde/shig-js-sdk.git
cd shig-js-sdk
npm run watch
cd dist/core
npm linkThe Shig WebClient is a good place to develop the SDK as well. To set up a develop environment for the SDK fallow the next steps.
cd web-client
npm i @shigde/core
npm startHave Fun!