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.
| Property | Value |
|---|---|
| Scope | None (open method) |
| Who can use it | Any developer |
| Status | Available |
Parameters
None. Send no params, or an empty object.
Result
| Field | Type | Description |
|---|---|---|
v | number | The bridge version. |
appId | string | Your app id. |
userId | string or null | A stable pseudonym for this person in your app only. null until profile.basic is granted. |
actionId | string | Present only when the app was opened from an Action. |
roomId | string | Present only when the app was opened from a Room. |
Errors
| Code | When |
|---|---|
4290 | More than 30 requests in 10 seconds. |
See Error Codes for every code and how they reach your page.
Example
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
userIdis the pseudonym, so it leaves the phone only after consent. Withoutprofile.basicit is alwaysnull, and that is not an error.- The
userIddiffers 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.