Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/code/forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ const config: ForgeConfig = {
icon: "./build/app-icon.png",
categories: ["Development"],
bin: "PostHog Code",
// Declare the custom URL scheme handler in the generated .desktop file
// so desktop integration registers x-scheme-handler/posthog-code and
// OAuth callbacks (posthog-code://) can route back to the AppImage.
// The deb/rpm makers get this via sharedLinuxOptions; without it,
// AppImage users cannot complete login. See sharedLinuxOptions.mimeType.
mimeType: ["x-scheme-handler/posthog-code"],
},
}),
new MakerDeb({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export class ElectronAppLifecycle implements IAppLifecycle {
}

public registerDeepLinkScheme(scheme: string): void {
// NOTE: setAsDefaultProtocolClient's optional `path`/`args` are Windows-only
// and ignored on Linux/macOS. On Linux, registration relies on the packaged
// .desktop file declaring `MimeType=x-scheme-handler/<scheme>` so desktop
// integration can route the scheme — see forge.config.ts (the AppImage,
// deb, and rpm makers all set `mimeType`). Passing an AppImage exec path
// here would be a no-op, so it is intentionally omitted.
app.setAsDefaultProtocolClient(scheme);
}
}
Loading