Core Methodscontext.get

context.get

Tells your app where it was opened from and, with consent, who the person is to your app.

Returns the app id and, when your app was opened from an Action or a Room, which one. The per-app userId is included only after the person has granted profile.basic.

PropertyValue
ScopeNone (open method)
Who can use itAny developer
StatusAvailable

Parameters

None. Send no params, or an empty object.

Result

FieldTypeDescription
vnumberThe bridge version.
appIdstringYour app id.
userIdstring or nullA stable pseudonym for this person in your app only. null until profile.basic is granted.
actionIdstringPresent only when the app was opened from an Action.
roomIdstringPresent only when the app was opened from a Room.

Errors

CodeWhen
4290More than 30 requests in 10 seconds.

See Error Codes for every code and how they reach your page.

Example

js
const ctx = await window.aksa.request({ method: "context.get" });
if (ctx.actionId) {
  // Opened from an Action: no need to ask the person to link one.
}

Notes

  • userId is the pseudonym, so it leaves the phone only after consent. Without profile.basic it is always null, and that is not an error.
  • The userId differs for every app. It means nothing anywhere else. See User Identity And Email.

Used By

Ready To Build Or Ship?

Check your files, preview on an iPhone frame, and submit in the Developer Studio.