Skip to content

Opening the phone from your own scenes

window.BMFT.Hermes.openShell(trigger, appId) / closeShell(returnValue) are the same two functions every internal call site already uses (the sidebar widget's own tap handler, the auto-open-on-discovery flow) — public, not Hermes-internal-only. Feature-detect the same way as Apps.register(), call openShell() from a (link:)/<script> in your own passage, done.

Two real things worth knowing before you do:

  • openShell() refuses to open for a player who hasn't found the phone yet. It checks BMFT.Hermes.isFound() itself and returns false without doing anything if that's not true — you don't need to (and can't easily bypass it) — but that also means your own scene should check isFound() first if it wants to explain WHY nothing happened, since openShell() fails silent, same degrade-to-no-op convention as its other guards.
  • appId (optional, second argument) deep-links straight to your own app instead of Home. Pass your app's own registered id and, if it resolves to a real registered app, that's the first screen shown; omit it (or pass an id that doesn't resolve) and it falls back to the normal lowest-order default.

trigger, if you have it (the DOM element the player just clicked), lets focus return there when the shell closes; null is fine too.

Zlib Licensed