We have a project in which Hub Premium would be used to support community identities. The question we have is this: we want to create a custom web app using JSAPI that allows users to sign up to join a community Hub organization. Is there a code sample out there that would illustrate this? Does the app need to somehow be registered to an initiative?
I “think” what I’m after is code that does this type of OAuth, whereby if the user isn’t already part of the community org, then they’re prompted to create an account:

Any insight would be appreciated,
Matt English