SDKs¶
Tele's REST API works from any language, and these open-source libraries handle the token signing, the request types and the webhook verification for you. Each is MIT licensed and installs from a release tag on GitHub.
| Library | For | Install |
|---|---|---|
| tele-go | Go backends: token signer, a typed client for every endpoint in this guide, a webhook http.Handler |
go get github.com/cloudguys-io/tele-go@v0.2.0 |
| tele-fastapi | Python backends: signer, sync and async clients, webhook verification, FastAPI routers for tokens, joins and webhooks | pip install "tele-fastapi[fastapi] @ git+https://github.com/cloudguys-io/tele-fastapi@v0.2.0" |
| tele-ui-pack | Any web app: the <tele-call> call screen and a React wrapper. See Prebuilt call UI |
npm install github:cloudguys-io/tele-ui-pack#v0.2.1 livekit-client |
| tele-nextjs-ui | Next.js App Router: TeleCallRoom, TeleInvitePreview and TeleJoinPage client components on top of <tele-call>. UI only; pair it with a backend library |
npm install github:cloudguys-io/tele-nextjs-ui#v0.2.0 github:cloudguys-io/tele-ui-pack#v0.2.1 livekit-client |
| tele-flutter | Flutter apps: an API client acting as the signed-in user, a call controller on livekit_client, and a native TeleCallScreen |
pubspec git dependency, ref: v0.2.0. See Flutter |
Each repository's README has the full reference.
Backend libraries only on the backend
tele-go and tele-fastapi hold your API secret. Run them on your server; apps get short-lived user tokens from it, as described in Authentication.
How the pieces fit¶
-
Your backend uses tele-go or tele-fastapi to issue user tokens and to serve a few routes under
/api/telethat your apps call. The libraries and UI kits share these defaults, so they work together without configuration:Route Does POST /api/tele/tokenIssues a user token for the signed-in user: {token, expires_at}GET /api/tele/invites/{code}Invite preview, as the user POST /api/tele/invites/{code}/joinInvite join with a service token that carries the user's IP POST /api/tele/calls/{id}/joinCall join with a service token that carries the user's IP GET /api/tele/calls/{id}/messagesChat history, as the user POST /api/tele/calls/{id}/diagnosticsForwards the call screen's diagnostics tele-fastapi serves them with
tele_token_routerandtele_join_router; tele-go'sexamples/backendshows the same routes onnet/http. Errors use Tele's{"error": {"code", "message"}}shape. -
Your web app renders tele-nextjs-ui or tele-ui-pack and points it at those routes (the Next.js kit does by default).
- Your mobile app uses tele-flutter with a token provider that calls
POST /api/tele/token. - Your backend receives webhooks through the library's webhook handler.
Which IP Tele records
Tele records the address that sends the join request and trusts no customer proxy, so:
- Call joins through
POST /api/tele/calls/{id}/joinuse a service token that passes the user's IP and user agent. Tele records the user's IP. - Invite joins record the IP of whoever sends them. Apps that call
POST /v1/invites/{code}/jointhemselves with a user token (browsers can, CORS is open) record the user's IP. A backend that redeems the invite should send a service token with the user's IP, as for call joins. The libraries' invite join route does this from v0.2.0; v0.1.0 used a user token, which recorded the backend's IP, so upgrade. - After the first invite join the user is a member of the call, so reconnects should use the call join route. tele-flutter and tele-nextjs-ui's
TeleJoinPagedo this for you. - If your web app reaches the backend through a proxy or a Next.js rewrite, have the backend take the user's IP from
X-Forwarded-For, trusted only from that proxy.
Browsers can call Tele directly
The Tele API allows any origin (CORS), and authenticates only with the Authorization header. Browser code, including Flutter web, can call it with a user token, or go through your backend.