Account card
Embed the user card that shows who is signed in, with its Manage account, Help and Sign out actions, and handle the events that leave the iframe.
The account widget shows the card of the user that the token or API key belongs to: the picture, the name and the email, with the buttons Manage your account, Help and Sign Out. When the user presses the first and the last, the widget sends a message to your page. Help works by itself.
URL and parameters
The parameters that start with _, except the two below, are the same for every widget. See Widgets.
| Parameter | Meaning | Required |
|---|---|---|
_app | The id of the App that shows the card, such as drive. Help opens the guide of that App. | No |
_release | The version that App runs, such as 5.0.3. Help opens the Manual of this version. | No |
Without _app and _release, Help opens the front page of the Manual of the platform's own version.
Messages
This widget does not send ready and does not take post-widget-parameters. For the other common messages see Widgets.
| action | Direction | payload |
|---|---|---|
view-account | widget to your page | The entry of the Account App from the platform's list of Apps. Use its url to take the user to Account. |
sign-out | widget to your page | None. |
The widget does not sign out and does not navigate by itself. On sign-out your page must clear its token and take the user away.
Help is a link that opens a new tab, and it sends no message.
Example
const messageToken = crypto.randomUUID()
const params = new URLSearchParams({
_credential_type: 'bearer-token',
_token: token,
_origin: location.origin,
_message_token: messageToken,
_locale: 'en',
_app: 'my-app',
_release: '5.0.3',
})
frame.src = `${site}/widgets/account?${params}`
addEventListener('message', (e) => {
if (e.origin !== site || e.data.messageToken !== messageToken) return
if (e.data.action === 'view-account') window.open(e.data.payload.url, '_blank')
if (e.data.action === 'sign-out') signOut() // clear your own token
})Expression builder
Embed the expression builder that composes a text from your own words and the values of fields, and receive the text the user writes.
Launcher
Embed the grid of the Apps installed on the site, so the user can open another App from your page, either by a link or by a message that you handle.