Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Every application client below is interchangeable with the others, because:
Every application server below has two specific purposes:

- Generate LiveKit tokens on demand for any [application client](#application-client-tutorials).
- Receive LiveKit [webhook events](https://docs.livekit.io/home/server/webhooks/){target=\_blank}.
- Receive LiveKit [webhook events](https://openvidu.io/latest/docs/reference/webhooks/){target=\_blank}.

To do so they all define two REST endpoints:

Expand Down
4 changes: 2 additions & 2 deletions docs/openvidu-vs-livekit.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Whenever you are ready to deploy your real-time application, OpenVidu for produc

## Egress and Ingress out of the box

LiveKit allows you to export media from a Room (for example recording it) or import media into a Room (for example ingesting a video file), using [Egress](https://docs.livekit.io/home/egress/overview/){target="_blank"} and [Ingress](https://docs.livekit.io/home/ingress/overview/){target="_blank"} services respectively. These modules are independent of LiveKit Server and must be correctly configured and connected via a shared Redis.
LiveKit allows you to export media from a Room (for example recording it) or import media into a Room (for example ingesting a video file), using [Egress](https://openvidu.io/latest/docs/reference/egress/){target="_blank"} and [Ingress](https://openvidu.io/latest/docs/reference/ingress/){target="_blank"} services respectively. These modules are independent of LiveKit Server and must be correctly configured and connected via a shared Redis.

When running OpenVidu locally you will have all these services properly integrated, so you can focus on developing your app without worrying about anything else.

## S3 compatible storage

If you are planning to make use of the [Egress](https://docs.livekit.io/home/egress/overview/){target="_blank"} service to export media out of your Rooms, you will need an S3 compatible bucket to store the generated files, and configure your LiveKit deployment to use it.
If you are planning to make use of the [Egress](https://openvidu.io/latest/docs/reference/egress/){target="_blank"} service to export media out of your Rooms, you will need an S3 compatible bucket to store the generated files, and configure your LiveKit deployment to use it.

When running OpenVidu locally you will have an S3 compatible storage available right away ([MinIO](https://min.io/){target="_blank"}).

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/advanced-features/recording-basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ There are three new environment variables:

Besides, the `index.js` file configures the server to serve static files from the `public` directory.

It also initializes the `EgressClient`, which will help interacting with [Egress API](https://docs.livekit.io/home/egress/api/){:target="\_blank"} to manage recordings, and the `S3Service`, which will help interacting with the S3 bucket:
It also initializes the `EgressClient`, which will help interacting with [Egress API](https://openvidu.io/latest/docs/reference/egress/){:target="\_blank"} to manage recordings, and the `S3Service`, which will help interacting with the S3 bucket:

```javascript title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/advanced-features/openvidu-recording-basic-node/src/index.js#L34-L39' target='_blank'>index.js</a>" linenums="34"
const egressClient = new EgressClient(
Expand Down
10 changes: 5 additions & 5 deletions docs/tutorials/application-server/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Learn how to build a minimal .NET application server with ASP.NET t
This is a minimal server application built for .NET with [ASP.NET Core Minimal APIs](https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-6.0&tabs=visual-studio){:target="\_blank"} that allows:

- Generating LiveKit tokens on demand for any [application client](../application-client/index.md).
- Receiving LiveKit [webhook events](https://docs.livekit.io/home/server/webhooks/){target=\_blank}.
- Receiving LiveKit [webhook events](https://openvidu.io/latest/docs/reference/webhooks/){target=\_blank}.

It internally uses the [LiveKit .NET SDK](https://github.com/pabloFuente/livekit-server-sdk-dotnet){:target="\_blank"}.

Expand Down Expand Up @@ -147,20 +147,20 @@ app.MapPost(
1. The endpoint obtains a Dictionary from the body request, and check if fields `roomName` and `participantName` are available.
2. A new `AccessToken` is created providing the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`.
3. We set participant's name and identity in the AccessToken.
4. We set the video grants in the AccessToken. `RoomJoin` allows the user to join a room and `RoomName` determines the specific room. Check out all [Video Grants](https://docs.livekit.io/home/get-started/authentication/#Video-grant){:target="\_blank"}.
4. We set the video grants in the AccessToken. `RoomJoin` allows the user to join a room and `RoomName` determines the specific room. Check out all [Video Grants](https://openvidu.io/latest/docs/reference/access-tokens/#video-grants){:target="\_blank"}.
5. Obtain the JWT string from the AccessToken.
6. Return the token to the client.
7. Return a `400` error if required fields are not available.

The endpoint obtains a Dictionary from the body request, and check if fields `roomName` and `participantName` are available. If not, it returns a `400` error. If required fields are available, a new `AccessToken` is created with the proper participant's identity, name and video grants. The `RoomJoin` grant allows the user to join a room and the `Room` grant determines the specific room. Check out all [Video Grants](https://docs.livekit.io/home/get-started/authentication/#Video-grant){:target="\_blank"}.
The endpoint obtains a Dictionary from the body request, and check if fields `roomName` and `participantName` are available. If not, it returns a `400` error. If required fields are available, a new `AccessToken` is created with the proper participant's identity, name and video grants. The `RoomJoin` grant allows the user to join a room and the `Room` grant determines the specific room. Check out all [Video Grants](https://openvidu.io/latest/docs/reference/access-tokens/#video-grants){:target="\_blank"}.

Finally, the returned token is sent back to the client.

---

#### Receive webhook

The endpoint `/livekit/webhook` accepts `POST` requests with a payload of type `application/webhook+json`. This is the endpoint where LiveKit Server will send [webhook events](https://docs.livekit.io/home/server/webhooks/#Events){:target="\_blank"}.
The endpoint `/livekit/webhook` accepts `POST` requests with a payload of type `application/webhook+json`. This is the endpoint where LiveKit Server will send [webhook events](https://openvidu.io/latest/docs/reference/webhooks/#events){:target="\_blank"}.

```cs title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/dotnet/Program.cs#L70-L95' target='_blank'>Program.cs</a>" linenums="70"
app.MapPost(
Expand Down Expand Up @@ -191,7 +191,7 @@ app.MapPost(
);
```

1. Initialize the WebhookReceiver using the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`. It will help validating and decoding incoming [webhook events](https://docs.livekit.io/home/server/webhooks/){target=\_blank}.
1. Initialize the WebhookReceiver using the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`. It will help validating and decoding incoming [webhook events](https://openvidu.io/latest/docs/reference/webhooks/){target=\_blank}.
2. The raw string body of the request contains the webhook event.
3. The `Authorization` header is required to validate the webhook event.
4. Obtain the `WebhookEvent` object using the `WebhookReceiver#Receive` method. It takes the raw body as a String and the Authorization header of the request.
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/application-server/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Learn how to build a minimal Go application server with Gin to gene
This is a minimal server application built for Go with [Gin](https://gin-gonic.com/){:target="\_blank"} that allows:

- Generating LiveKit tokens on demand for any [application client](../application-client/index.md).
- Receiving LiveKit [webhook events](https://docs.livekit.io/home/server/webhooks/){target=\_blank}.
- Receiving LiveKit [webhook events](https://openvidu.io/latest/docs/reference/webhooks/){target=\_blank}.

It internally uses the [LiveKit Go SDK](https://pkg.go.dev/github.com/livekit/server-sdk-go){:target="\_blank"}.

Expand Down Expand Up @@ -123,7 +123,7 @@ func createToken(context *gin.Context) {
```

1. A new `AccessToken` is created providing the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`.
2. We set the video grants and identity of the participant in the AccessToken. `RoomJoin` allows the user to join a room and `Room` determines the specific room. Check out all [Video Grants](https://docs.livekit.io/home/get-started/authentication/#Video-grant){:target="\_blank"}.
2. We set the video grants and identity of the participant in the AccessToken. `RoomJoin` allows the user to join a room and `Room` determines the specific room. Check out all [Video Grants](https://openvidu.io/latest/docs/reference/access-tokens/#video-grants){:target="\_blank"}.
3. We convert the AccessToken to a JWT token.
4. Finally, the token is sent back to the client.

Expand All @@ -132,15 +132,15 @@ We first load the request body into a struct with `roomName` and `participantNam
If required fields are available, a new JWT token is created. For that we use the [LiveKit Go SDK](https://pkg.go.dev/github.com/livekit/server-sdk-go){:target="\_blank"}:

1. A new `AccessToken` is created providing the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`.
2. We set the video grants and identity of the participant in the AccessToken. `RoomJoin` allows the user to join a room and `Room` determines the specific room. Check out all [Video Grants](https://docs.livekit.io/home/get-started/authentication/#Video-grant){:target="\_blank"}.
2. We set the video grants and identity of the participant in the AccessToken. `RoomJoin` allows the user to join a room and `Room` determines the specific room. Check out all [Video Grants](https://openvidu.io/latest/docs/reference/access-tokens/#video-grants){:target="\_blank"}.
3. We convert the AccessToken to a JWT token and return it to the client.
4. Finally, the token is sent back to the client.

---

### Receive webhook

The endpoint `/livekit/webhook` accepts `POST` requests with a payload of type `application/webhook+json`. This is the endpoint where LiveKit Server will send [webhook events](https://docs.livekit.io/home/server/webhooks/#Events){:target="\_blank"}.
The endpoint `/livekit/webhook` accepts `POST` requests with a payload of type `application/webhook+json`. This is the endpoint where LiveKit Server will send [webhook events](https://openvidu.io/latest/docs/reference/webhooks/#events){:target="\_blank"}.

```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go#L51-L61' target='_blank'>main.go</a>" linenums="51"
func receiveWebhook(context *gin.Context) {
Expand All @@ -157,13 +157,13 @@ func receiveWebhook(context *gin.Context) {
```

1. Create a `SimpleKeyProvider` with the `LIVEKIT_API_KEY` and `LIVEKIT_API`.
2. Receive the webhook event providing the `http.Request` in the Gin context and the `SimpleKeyProvider` we just created. This will validate and decode the incoming [webhook event](https://docs.livekit.io/home/server/webhooks/){:target="\_blank"}.
2. Receive the webhook event providing the `http.Request` in the Gin context and the `SimpleKeyProvider` we just created. This will validate and decode the incoming [webhook event](https://openvidu.io/latest/docs/reference/webhooks/){:target="\_blank"}.
3. Consume the event as you whish.

<span></span>

1. Create a `SimpleKeyProvider` with the `LIVEKIT_API_KEY` and `LIVEKIT_API`.
2. Receive the webhook event providing the `http.Request` in the Gin context and the `SimpleKeyProvider` we just created. This will validate and decode the incoming [webhook event](https://docs.livekit.io/home/server/webhooks/){:target="\_blank"}.
2. Receive the webhook event providing the `http.Request` in the Gin context and the `SimpleKeyProvider` we just created. This will validate and decode the incoming [webhook event](https://openvidu.io/latest/docs/reference/webhooks/){:target="\_blank"}.
3. Consume the event as you whish.

--8<-- "shared/webhook-local-server.md"
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/application-server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Learn how to build an application server that generates LiveKit tok
Every application server below has two specific purposes:

- Generate LiveKit tokens on demand for any [application client](../application-client/index.md).
- Receive LiveKit [webhook events](https://docs.livekit.io/home/server/webhooks/){target=\_blank}.
- Receive LiveKit [webhook events](https://openvidu.io/latest/docs/reference/webhooks/){target=\_blank}.

To do so they all define two REST endpoints:

Expand Down
10 changes: 5 additions & 5 deletions docs/tutorials/application-server/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Learn how to build a minimal Java application server with Spring Bo
This is a minimal server application built for Java with [Spring Boot](https://spring.io/){:target="\_blank"} that allows:

- Generating LiveKit tokens on demand for any [application client](../application-client/index.md).
- Receiving LiveKit [webhook events](https://docs.livekit.io/home/server/webhooks/){target=\_blank}.
- Receiving LiveKit [webhook events](https://openvidu.io/latest/docs/reference/webhooks/){target=\_blank}.

It internally uses [LiveKit Kotlin SDK](https://github.com/livekit/server-sdk-kotlin){:target="\_blank"}.

Expand Down Expand Up @@ -103,7 +103,7 @@ public ResponseEntity<Map<String, String>> createToken(@RequestBody Map<String,

1. A new `AccessToken` is created providing the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`.
2. We set participant's name and identity in the AccessToken.
3. We set the video grants in the AccessToken. `RoomJoin` allows the user to join a room and `RoomName` determines the specific room. Check out all [Video Grants](https://docs.livekit.io/home/get-started/authentication/#Video-grant){:target="\_blank"}.
3. We set the video grants in the AccessToken. `RoomJoin` allows the user to join a room and `RoomName` determines the specific room. Check out all [Video Grants](https://openvidu.io/latest/docs/reference/access-tokens/#video-grants){:target="\_blank"}.
4. Finally, the token is sent back to the client.

The endpoint first obtains the `roomName` and `participantName` parameters from the request body. If they are not available, it returns a `400` error.
Expand All @@ -112,14 +112,14 @@ If required fields are available, a new JWT token is created. For that we use th

1. A new `AccessToken` is created providing the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`.
2. We set participant's name and identity in the AccessToken.
3. We set the video grants in the AccessToken. `RoomJoin` allows the user to join a room and `RoomName` determines the specific room. Check out all [Video Grants](https://docs.livekit.io/home/get-started/authentication/#Video-grant){:target="\_blank"}.
3. We set the video grants in the AccessToken. `RoomJoin` allows the user to join a room and `RoomName` determines the specific room. Check out all [Video Grants](https://openvidu.io/latest/docs/reference/access-tokens/#video-grants){:target="\_blank"}.
4. Finally, the token is sent back to the client.

---

#### Receive webhook

The endpoint `/livekit/webhook` accepts `POST` requests with a payload of type `application/webhook+json`. This is the endpoint where LiveKit Server will send [webhook events](https://docs.livekit.io/home/server/webhooks/#Events){:target="\_blank"}.
The endpoint `/livekit/webhook` accepts `POST` requests with a payload of type `application/webhook+json`. This is the endpoint where LiveKit Server will send [webhook events](https://openvidu.io/latest/docs/reference/webhooks/#events){:target="\_blank"}.

```java title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/java/src/main/java/io/openvidu/basic/java/Controller.java#L50-L60' target='_blank'>Controller.java</a>" linenums="50"
@PostMapping(value = "/livekit/webhook", consumes = "application/webhook+json")
Expand All @@ -136,7 +136,7 @@ public ResponseEntity<String> receiveWebhook(@RequestHeader("Authorization") Str
```

1. We need the 'Authorization' header and the raw body of the HTTP request.
2. Initialize the WebhookReceiver using the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`. It will help validating and decoding incoming [webhook events](https://docs.livekit.io/home/server/webhooks/){target=\_blank}.
2. Initialize the WebhookReceiver using the `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET`. It will help validating and decoding incoming [webhook events](https://openvidu.io/latest/docs/reference/webhooks/){target=\_blank}.
3. Obtain the `WebhookEvent` object using the `WebhookReceiver#receive` method. It takes the raw body as a String and the Authorization header of the request.
4. Consume the event as you whish.

Expand Down
Loading