Skip to content

Commit e86fd7e

Browse files
authored
chore(server): allow canUpdateOwnMetadata by default (#21)
1 parent 7d8dc94 commit e86fd7e

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

TEMPLATE.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ async function createToken({ roomName, participantName }) {
3737
identity: participantName,
3838
ttl: '10m',
3939
});
40-
at.addGrant({ roomJoin: true, room: roomName });
41-
return await at.toJwt();
40+
at.addGrant({
41+
roomJoin: true,
42+
room: roomName,
43+
canUpdateOwnMetadata: true,
44+
});
45+
return at.toJwt();
4246
}
4347

4448
const app = express();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dependencies": {
1414
"dotenv": "^16.4.5",
1515
"express": "^4.21.1",
16-
"livekit-server-sdk": "^2.7.2"
16+
"livekit-server-sdk": "^2.8.1"
1717
},
1818
"devDependencies": {
1919
"@eslint/eslintrc": "^3.1.0",

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ async function createToken({ roomName, participantName }: TokenRequest) {
1919
});
2020
// Token permissions can be added here based on the
2121
// desired capabilities of the participant
22-
at.addGrant({ roomJoin: true, room: roomName });
23-
return await at.toJwt();
22+
at.addGrant({
23+
roomJoin: true,
24+
room: roomName,
25+
canUpdateOwnMetadata: true,
26+
});
27+
return at.toJwt();
2428
}
2529

2630
const app = express();

0 commit comments

Comments
 (0)