GitHub App Installation flow on mobile+web (multi platform)?

I’m preparing to submit the app to the Marketplace.

The app has three versions: Web, Electron and Mobile.

Since setting up the “Setup URL” is required by Marketplace, I made it redirect to the root url (

It works fine.

But how about on mobile? How do I make it redirect to a different URL or something like that?

Because it shouldn’t redirect to web version, it should trigger the myapp:// app scheme. Same thing for Electron. Any suggestion?

What I suggest is something similar to the oauth flow: If I could pass a query variable like “state” to the installation url (e.g. &state=MYSTATEHERE &maybeothervar=123) and GitHub included this query variable when redirecting to the Setup URL ( ?state=MYSTATEHERE ) then I would be able to handle it.

But since this isn’t possible, any suggestion?

I’ve just come up with a hacky solution:

  1. Instead of redirecting directly from the app to github, redirect to instead.

  2. This endpoint will save the app type (web/electron/mobile) as a cookie or localstorage.

  3. Redirects to github and install the app

  4. GitHub redirects to another endpoint of mine:

  5. This endpoint will check the cookie/localstorage, so now it knows the platform and what to do next. E.g. if mobile, redirect to myappscheme://.