diff --git a/src/elements/pages/dev/game/pages/game-tokens.ts b/src/elements/pages/dev/game/pages/game-tokens.ts
index 594abd79..360e9558 100644
--- a/src/elements/pages/dev/game/pages/game-tokens.ts
+++ b/src/elements/pages/dev/game/pages/game-tokens.ts
@@ -51,6 +51,31 @@ export default class DevGameTokens extends LitElement {
}
}
+ async createServiceToken() {
+ try {
+ let createRes = await global.api.cloud.games.namespaces.createGameNamespaceTokenService(
+ this.game.gameId,
+ this.namespace.namespaceId,
+ {
+ ttl: 365 * 24 * 60 * 60 * 1000
+ }
+ );
+
+ showAlert(
+ 'Namespace Service Token Creation',
+ html`
+
+ Copy this token to your clipboard. You will not be able to access this token again.
+ Expires in 365 days.
+
+
+ `
+ );
+ } catch (err) {
+ logging.error('Failed to create public token', err);
+ }
+ }
+
downloadEnvFile(token: string) {
utils.downloadData('_env', `RIVET_TOKEN=${token}`);
}
@@ -84,6 +109,17 @@ export default class DevGameTokens extends LitElement {
`;
}
+ },
+ {
+ name: 'Service Token',
+ url: 'https://rivet.gg/docs/general/concepts/handling-game-tokens#public-namespace-tokens',
+ description:
+ 'Service tokens are used from private API servers. These should never be shared.',
+ render: () => {
+ return html`
+ Generate
+ `;
+ }
}
];