Quickstart
This guide shows the shortest safe path for adding Blendlix Call Service to a web or mobile application.
1. Get product credentials from Blendlix
Ask Blendlix for:
| Value | Where it is used |
|---|---|
| Product key ID | Sent by the application backend as X-BCS-Product-Key-ID |
| Product secret | Sent by the application backend as X-BCS-Product-Secret |
| Call Service base URL | Used by the application backend to request session tokens |
Keep the product secret on the application backend only. Never put it in a browser app, mobile app, or public JavaScript bundle.
2. Add credentials to the backend environment
BLENDLIX_CALL_BASE_URL=https://rtc-svc.blendlix.com
BLENDLIX_CALL_PRODUCT_KEY_ID=your_key_id
BLENDLIX_CALL_PRODUCT_SECRET=your_secret
3. Create a backend endpoint
A client should not call Blendlix Call Service directly for a token. Instead:
- the client asks the application backend for a call session
- the backend checks whether the caller is allowed to call the receiver
- the backend calls
POST /v1/call/session-token - the backend returns the token response to the client
Example backend request to Blendlix Call Service:
POST https://rtc-svc.blendlix.com/v1/call/session-token
Content-Type: application/json
X-BCS-Product-Key-ID: your_key_id
X-BCS-Product-Secret: your_secret
{
"product": "example_application",
"role": "caller",
"user_id": "caller-123",
"display_name": "Caller One",
"context_type": "session",
"context_id": "SESSION-1001",
"allowed_peer_role": "receiver",
"permissions": [
"call:connect",
"call:invite",
"call:accept",
"call:reject",
"call:cancel",
"call:end"
]
}
4. Connect your client to WebSocket
The token response contains token, ws_url, and ice_servers.
Browser clients should connect like this:
const ws = new WebSocket(tokenResponse.ws_url, ['jwt', tokenResponse.token])
5. Start a call
Send a call.invite event over WebSocket:
{
"event": "call.invite",
"request_id": "req-1",
"data": {
"callee_user_id": "receiver-456",
"callee_role": "receiver",
"context_type": "session",
"context_id": "SESSION-1001"
}
}
After the callee accepts, use WebRTC events:
webrtc.offerwebrtc.answerwebrtc.ice_candidate