Add getToken comment in Vue tutorial

This commit is contained in:
juancarmore 2024-05-27 19:07:03 +02:00
parent f9cf994fa6
commit d90fc3bd81

View File

@ -106,6 +106,19 @@ onUnmounted(() => {
leaveRoom();
});
/**
* --------------------------------------------
* GETTING A TOKEN FROM YOUR APPLICATION SERVER
* --------------------------------------------
* The method below request the creation of a token to
* your application server. This prevents the need to expose
* your LiveKit API key and secret to the client side.
*
* In this sample code, there is no user control at all. Anybody could
* access your application server endpoints. In a real production
* environment, your application server must identify the user to allow
* access to the endpoints.
*/
async function getToken(roomName: string, participantName: string) {
const response = await fetch(APPLICATION_SERVER_URL + 'token', {
method: 'POST',