mountEmbeddedAppMarketplace() is built on two endpoints you can call
yourself, to show the marketplace in your own design system or to turn apps on
from your server, for example when you onboard an office.
Both take a user token with embed:enable as a bearer token: the same token, the
same user, as the marketplace component. They accept calls from any origin, so
your page can call them directly, and from your server.
The base URL is https://universal.rollout.com/api/embedded-apps.
List the apps
user is always granted. org is granted by embed:enable_org with an
embed.org claim.
Turn an app on or off
PUT turns the app on, DELETE turns it off, for scope user (the token’s
user) or org (the org in its embed.org). Both answer the app as the user
now sees it, in the shape of an entry in apps. Both are idempotent: turning
on an app that’s already on, or off one that’s already off, changes nothing.
403 ENABLEMENT_SCOPE_NOT_ALLOWED. Turning it off always works, so users can turn
off apps in a scope you stopped allowing.
Showing it the way Rollout’s component does
- Show a switch for each scope in
canEnable. For an app still on in a scope that’s incanDisablebut notcanEnable, show that switch too, so the user can turn it off. - When
enabled.orgis true, show the user’s own switch as on and disabled, with something like “Enabled by your org”. Only an org admin can turn it off, for the org. - After a change, call
refresh()on anymountEmbeddedApps()handle on the page, so the apps follow.
Error responses
An error answers with its HTTP status and a body naming its code:scope is neither
user nor org answers 422, with a body describing the invalid parameter.