Created
March 13, 2023 07:29
-
-
Save alsoamit/5806cdef12fc22c6aab6dc983983b0c1 to your computer and use it in GitHub Desktop.
Delete livestream using Mux SDK in aws Lambda Nodejs 18.x runtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Don't forget to include node_modules with "@mux/mux-node" installed in the Lambda | |
// Mux reads two environment variables MUX_TOKEN_ID and MUX_TOKEN_SECRET by default. Set them in the Lambda configuration. | |
import Mux from "@mux/mux-node"; | |
const { Video, Data } = new Mux(); | |
export const handler = async (event) => { | |
// Send id in the request body | |
// req.body = {id: <id-of-livestream-to-delete>} | |
const deletedLivestream = await Video.LiveStreams.del(event.id); | |
const response = { | |
statusCode: 200, | |
data: deletedLivestream | |
}; | |
return response; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment