Context
SDK exports context types:
ts
import type {
FrameContext,
AuthContext,
AccountContext,
AppContext,
PlacementContext,
RateLimitContext
} from '@aspro-cloud/miniapp-jssdk'Types
FrameContext
Main application context object returned by the Frame.getContext() method
| Property | Type | Description |
|---|---|---|
https | boolean | Secure connection protocol is used |
language | string | Interface language ('ru', 'en', etc.) |
domain | string | Domain of the current Аспро.Cloud account where the application is opened |
account | AccountContext | Current account data |
app | AppContext | Application and version data |
auth | AuthContext | Current authorized user data (OAuth2 tokens) |
placement | PlacementContext | Current embedding placement data in the platform interface |
ratelimit | RateLimitContext | API request limit data |
[key: string] | any | Additional data |
AccountContext
Current Аспро.Cloud account data where the application is opened
| Property | Type | Description |
|---|---|---|
id | string | Account identifier |
AppContext
Application and version data
| Property | Type | Description |
|---|---|---|
id | string | Application identifier |
version | string | Application version installed on the account (1.0.0, 0.2.100, etc.) |
AuthContext
Current authorized user data
| Property | Type | Description |
|---|---|---|
access_token | string | User's OAuth2 access token |
refresh_token | string | User's OAuth2 refresh token |
expires_at | string | Access token expiration date and time 2026-04-01 10:15:20 |
PlacementContext
Current embedding placement data in the platform interface
| Property | Type | Description |
|---|---|---|
id | string | Embedding placement identifier from the application version manifest |
code | string | Embedding type code (app.homepage, header.widget, etc.) |
props | object | Additional embedding placement parameters from the application version manifest |
RateLimitContext
Application API request limit data
| Property | Type | Description |
|---|---|---|
limit | number | Maximum number of requests per second |