Skip to content

Commit ac69e9f

Browse files
committed
hardcode public app ID
1 parent ff4dc2c commit ac69e9f

5 files changed

Lines changed: 11 additions & 14 deletions

File tree

.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ APPLE_CODESIGN_KEYCHAIN_PASSWORD="xxx"
1010
VITE_POSTHOG_API_KEY=xxx
1111
VITE_POSTHOG_API_HOST=xxx
1212
VITE_POSTHOG_UI_HOST=xxx
13-
14-
# Discord Rich Presence. Upload Rich Presence art assets named
15-
# "posthog_logo", "agent_running", and "posthog_idle" in the Discord app.
16-
VITE_DISCORD_CLIENT_ID=

apps/code/src/main/services/discord-presence/constants.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
/**
22
* Discord Rich Presence configuration.
33
*
4-
* The client id identifies the Discord Application whose name and uploaded
4+
* The client id is the public Discord Application ID whose name and uploaded
55
* Rich Presence art (the `*_IMAGE_KEY` assets below) show up on a user's
6-
* profile. Register an application at https://discord.com/developers and wire
7-
* its id through `VITE_DISCORD_CLIENT_ID` (see `.env.example`). Until a real id
8-
* is configured the service stays dormant and never opens a socket.
6+
* profile. It is a public identifier — only the application's client *secret*
7+
* (unused by Rich Presence) is sensitive — so it ships in the build for every
8+
* client. Register an application at https://discord.com/developers, upload the
9+
* art assets, then drop its ID here.
910
*/
11+
// TODO: replace with the real PostHog Code Discord Application ID.
12+
const DISCORD_CLIENT_ID = "1511709200017920020";
13+
1014
export function getDiscordClientId(): string {
11-
return process.env.VITE_DISCORD_CLIENT_ID ?? "";
15+
return DISCORD_CLIENT_ID;
1216
}
1317

1418
/** Asset keys uploaded under the Discord app's Rich Presence → Art Assets. */

apps/code/src/main/services/discord-presence/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class DiscordPresenceService extends TypedEventEmitter<DiscordPresenceSer
110110
private connect(): void {
111111
if (!this.clientId) {
112112
log.warn(
113-
"VITE_DISCORD_CLIENT_ID is not configured; Discord Rich Presence will stay dormant",
113+
"No Discord Application ID is set; Discord Rich Presence will stay dormant",
114114
);
115115
return;
116116
}

apps/code/src/renderer/features/settings/components/sections/DiscordSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function DiscordSettings() {
104104
{!configured ? (
105105
<Text color="yellow" className="-mt-3 pb-3 text-[13px]">
106106
No Discord application is configured for this build, so nothing
107-
will appear yet. Set VITE_DISCORD_CLIENT_ID to connect.
107+
will appear yet.
108108
</Text>
109109
) : (
110110
<Text

apps/code/vite.main.config.mts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,6 @@ export default defineConfig(({ mode }) => {
626626
"process.env.VITE_POSTHOG_ACCESS_TOKEN_OVERRIDE": JSON.stringify(
627627
env.VITE_POSTHOG_ACCESS_TOKEN_OVERRIDE || "",
628628
),
629-
"process.env.VITE_DISCORD_CLIENT_ID": JSON.stringify(
630-
env.VITE_DISCORD_CLIENT_ID || "",
631-
),
632629
"process.env.SKILLS_ZIP_URL": JSON.stringify(SKILLS_ZIP_URL),
633630
"process.env.CONTEXT_MILL_ZIP_URL": JSON.stringify(CONTEXT_MILL_ZIP_URL),
634631
...createForceDevModeDefine(),

0 commit comments

Comments
 (0)