Skip to content

GetIceServerConfig

Source: src/AWS/KinesisVideo/GetIceServerConfig.ts

Runtime binding for kinesisvideo:GetIceServerConfig (WebRTC signaling data plane).

Bind this operation to a SignalingChannel inside a function runtime to get a callable that resolves the per-channel HTTPS signaling endpoint (GetSignalingChannelEndpoint) and returns TURN server URIs with short-lived credentials for establishing WebRTC connectivity.

ICE Server Configuration

// init
const getIceServers = yield* AWS.KinesisVideo.GetIceServerConfig(channel);
// runtime
const { IceServerList } = yield* getIceServers({ ClientId: "viewer-1" });

Wire into a Lambda Function

// Provide the GetIceServerConfigHttp layer on the Function's init Effect.
export default SignalingFunction.make(
{ main: import.meta.url, url: true, timeout: Duration.seconds(30) },
Effect.gen(function* () {
const channel = yield* AWS.KinesisVideo.SignalingChannel("Doorbell");
const getIceServers = yield* AWS.KinesisVideo.GetIceServerConfig(channel);
return {
fetch: Effect.gen(function* () {
const { IceServerList } = yield* getIceServers({
ClientId: "viewer-1",
});
return HttpServerResponse.json({ iceServers: IceServerList });
}),
};
}).pipe(Effect.provide(AWS.KinesisVideo.GetIceServerConfigHttp)),
);