Extension onInstall hook?

Hi,

You are going to be surprised but it’s kind of question about authentication (and I already saw FAQ). Basically everything is working fine with authentication itself (Authorization code grant flow), but don’t see what is the best approach from user interaction perspective. I mean, what is the preferred way of telling/navigating user to authentication page. What options I see now:

  1. Request needed scopes upon extension activation. I have no idea how it could be done, if there is some “onInstall” hooks or special install.js scripts or manifest… I just know that it’s working this way with Voicemod Live | Voice changer extension and, as for me, it’s a very good approach to let user know from the beginning, that some access is required. Any hints how it’s implemented?

  2. Add some button in the extension configuration interface and window.open(‘url’) from the script. The problem is that I cannot get the result of this operation from opened window (window.opener.postMessage is received by supervisor, I guess, but not my iframe), so the only way of displaying if everything is fine - is polling for backend (not nice), or trying to use pubsub messaging (not intended for this, for real), or installing some websocket connection with the backend (a little bit overkill for configuration page).

So… my question is - what is the preferred workflow of requesting some access for user for extension? What am I missing?

Any help would be appreciated. Thanks!

thats a long removed part of extensions (scopes at install other than the subscribers scope), and theres no “onInstall” hook

But the config view is how you would ask for additional authentication, as you noted in 2.:

At first install broadcasters are generally poked to go to said config view.

Examples:

Don’t use window open, use <a href="yourEBSpage" target="_blank">Click here to Auth

No need to poll, or use postMessage or a socket, you can use extension pubsub to broadcast a message to your Extension Front end that auth is completed. With no additionally “depenancies” or schnangians