Skip to content

Commit

Permalink
chore(server): allow canUpdateOwnMetadata by default (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
rektdeckard authored Nov 19, 2024
1 parent 7d8dc94 commit e86fd7e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ async function createToken({ roomName, participantName }) {
identity: participantName,
ttl: '10m',
});
at.addGrant({ roomJoin: true, room: roomName });
return await at.toJwt();
at.addGrant({
roomJoin: true,
room: roomName,
canUpdateOwnMetadata: true,
});
return at.toJwt();
}

const app = express();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"dotenv": "^16.4.5",
"express": "^4.21.1",
"livekit-server-sdk": "^2.7.2"
"livekit-server-sdk": "^2.8.1"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ async function createToken({ roomName, participantName }: TokenRequest) {
});
// Token permissions can be added here based on the
// desired capabilities of the participant
at.addGrant({ roomJoin: true, room: roomName });
return await at.toJwt();
at.addGrant({
roomJoin: true,
room: roomName,
canUpdateOwnMetadata: true,
});
return at.toJwt();
}

const app = express();
Expand Down

0 comments on commit e86fd7e

Please sign in to comment.