wolmi / livekit-webhook-proxy

This is a proxy to allow sending livekit webhook events to a GCP PubSub topic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

livekit-webhook-proxy

This is a proxy to allow sending Livekit webhook events to a GCP PubSub topic

config.yaml example

port: 8080
topic: <pubsub-topic>
project-id: <gcp-project-id>

How to use it

The simplest way to authenticate to GCP PubSub is to use a service account with the proper permission. You can use the environment variable GOOGLE_APPLICATION_CREDENTIALS to specify where the service account json file is located, inside a GKE cluster or GCE instance it will be detected atomatically.

export GOOGLE_APPLICATION_CREDENTIALS=sa.json
livekit-webhook-proxy --config config.yaml

Configure your Livekit server

Once you have the proxy running and accessible by your Livekit server you have to activate the webhook and send it to the /publish endpoint

webhooks:
  api_key: <key>
  urls:
    - "https://webhook-proxy:8080/publish"

# Test with docker-compose

Fist you have to set the right config in the livekit.yaml config file to set the key:secret and also create a config.yaml

docker-compose up

You will need to generate a valid token with your key:secret and you hace test it in the React example from Livekit.

In the environment variables of the proxy it assumes you have gcloud properly configured with de application_default_credentials.json located in the default home folder. If you want to use a different service account or it's not in the right location plase eddit the docker-compose.yaml

About

This is a proxy to allow sending livekit webhook events to a GCP PubSub topic

License:Apache License 2.0


Languages

Language:Go 78.2%Language:Smarty 16.4%Language:Dockerfile 5.4%