@appboxo/web-sdk 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,6 @@ const sdk = new AppboxoWebSDK({
|
|
|
41
41
|
sandboxMode?: boolean; // Optional, default: false
|
|
42
42
|
debug?: boolean; // Optional, default: false. When true, enables all console logs for debugging. When false, no console logs are output.
|
|
43
43
|
locale?: string; // Optional, locale/language code (e.g., 'en', 'en-US', 'ru', 'zh-CN')
|
|
44
|
-
isDesktop?: boolean; // Optional, default: false. When true, API calls to fetch miniapp settings will include is_desktop=true parameter
|
|
45
44
|
onGetAuthCode?: () => Promise<string>; // Optional, for automatic auth code retrieval
|
|
46
45
|
onGetAuthTokens?: () => Promise<LoginResponse>; // Optional, for direct auth tokens
|
|
47
46
|
onPaymentRequest?: (params: PaymentRequest) => Promise<PaymentResponse>; // Optional, for handling payment requests
|
|
@@ -174,23 +173,6 @@ The locale is passed to the miniapp via `InitData.data.locale` on the next `AppB
|
|
|
174
173
|
- If you call `setLocale()` after the miniapp has already loaded, the locale will be included in the next InitData request. The miniapp may need to reload or request InitData again to receive the updated locale.
|
|
175
174
|
- To ensure the locale is available immediately, set it during SDK initialization or before calling `mount()`.
|
|
176
175
|
|
|
177
|
-
### Desktop Mode
|
|
178
|
-
|
|
179
|
-
When `isDesktop: true` is set, the SDK will include `is_desktop=true` parameter when fetching miniapp settings from the API. This allows the backend to return desktop-specific configurations.
|
|
180
|
-
|
|
181
|
-
```typescript
|
|
182
|
-
const sdk = new AppboxoWebSDK({
|
|
183
|
-
clientId: "your-client-id",
|
|
184
|
-
appId: "your-app-id",
|
|
185
|
-
isDesktop: true // Enable desktop mode
|
|
186
|
-
});
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
When enabled, API calls to `/miniapps/{appId}/settings/` will include the `is_desktop=true` query parameter:
|
|
190
|
-
```
|
|
191
|
-
GET /miniapps/{appId}/settings/?client_id={clientId}&is_desktop=true
|
|
192
|
-
```
|
|
193
|
-
|
|
194
176
|
### Logout
|
|
195
177
|
|
|
196
178
|
The `logout()` method clears the host app's storage and SDK's internal authentication data.
|