I have recently started to integrate the itch.io API and the Discord RPC API into a new game of mine. The Discord RPC API uses Unix domain sockets on Mac and Linux, and named pipes on Windows.
I have tried to get it to work inside the itch app, and I can open the socket, but it fails in a rather tricky way: Firejail hides all other processes. Inside firejail it looks like I have PID 3, and I can't get my "external" PID. When I try to talk to Discord, Discord can't find my game process running, but it looks like everything works fine and my game runs as PID 3.
I probably won't even be able to open the named pipe on Win32 because the game is not running as the user who crated the pipe, but I haven't checked that yet.
I like that I can mark my game as sandbox-compatible in the manifest, but if I don't think I will opt my games into them yet, if it works inconsistently across platforms.
If I could get an environment variable like ITCHIO_SANDBOX=firejail or ITCHIO_SANDBOX=win_user, that would help a bunch. I could just disable the Discord RPC and save myself headache and bug reports, and if the variable isn't set, I could go on as usual.
Even better for Discord RPC specifically would be a way to get the PID (like in ITCHIO_GAME_PID=12345) from the butler process that started the game, but that's such a Discord-specific thing I'm not sure it's worth the effort, and if you decide to put effort into Discord things, you (probably Amos) might as well implement the presence API yourself, because know the game's name (but not the internal game state).
Are there any other devs on itch.io who use SDKs and APIs like that?