aWhere Manual
DevelopWidgets

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.

ParameterMeaningRequired
_appThe id of the App that shows the card, such as drive. Help opens the guide of that App.No
_releaseThe 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.

actionDirectionpayload
view-accountwidget to your pageThe entry of the Account App from the platform's list of Apps. Use its url to take the user to Account.
sign-outwidget to your pageNone.

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
})

On this page