@wix/himalaya-cli 0.1297.0 → 0.1298.0
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/dist/cli.mjs +2 -0
- package/guides/index.json +12 -0
- package/guides/web-page-native-sdk.md +286 -0
- package/guides/web-page-sdk-reference.md +642 -0
- package/guides/webview-page-sdk.md +8 -1
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -7530,6 +7530,7 @@ function buttonVariant(style) {
|
|
|
7530
7530
|
var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, BUTTON_MIN_HIT_TARGET, nonNegative, nonEmpty, own, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS, BUTTON_VARIANTS;
|
|
7531
7531
|
var init_tokens = __esm({
|
|
7532
7532
|
"../../core/ts/src/tokens.ts"() {
|
|
7533
|
+
"use strict";
|
|
7533
7534
|
SYSTEM_FONT_FAMILY = "$system";
|
|
7534
7535
|
TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
|
|
7535
7536
|
BUTTON_MIN_HIT_TARGET = 44;
|
|
@@ -7585,6 +7586,7 @@ function resolveTranslation(value, catalog3, sourceCatalog) {
|
|
|
7585
7586
|
var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
|
|
7586
7587
|
var init_bindings = __esm({
|
|
7587
7588
|
"../../core/ts/src/bindings.ts"() {
|
|
7589
|
+
"use strict";
|
|
7588
7590
|
BINDING_SIGILS = ["service", "flag", "item", "t"];
|
|
7589
7591
|
BINDING_SIGIL_RE = new RegExp(
|
|
7590
7592
|
`^\\$(?:${BINDING_SIGILS.filter((s2) => s2 !== "t").join("|")})\\b|^\\$t:`
|
package/guides/index.json
CHANGED
|
@@ -95,6 +95,18 @@
|
|
|
95
95
|
"category": "Workers & SDKs",
|
|
96
96
|
"file": "webview-page-sdk.md"
|
|
97
97
|
},
|
|
98
|
+
{
|
|
99
|
+
"id": "web-page-native-sdk",
|
|
100
|
+
"title": "Call native device features from a web page inside a Himi app",
|
|
101
|
+
"category": "Workers & SDKs",
|
|
102
|
+
"file": "web-page-native-sdk.md"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "web-page-sdk-reference",
|
|
106
|
+
"title": "Web page SDK reference",
|
|
107
|
+
"category": "Workers & SDKs",
|
|
108
|
+
"file": "web-page-sdk-reference.md"
|
|
109
|
+
},
|
|
98
110
|
{
|
|
99
111
|
"id": "component-reference",
|
|
100
112
|
"title": "Component reference",
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# Call native device features from a web page inside a Himi app
|
|
2
|
+
|
|
3
|
+
This guide is for anyone — a person or a coding agent such as Base44, Lovable or Claude — building
|
|
4
|
+
a web page (React or plain JavaScript) that will be shown **inside** a Himi mobile app, such as a
|
|
5
|
+
Brandy app that wraps a website. From that page you can call the phone's native features: Health
|
|
6
|
+
(HealthKit / Health Connect), haptics, camera, share, location, secure storage and more.
|
|
7
|
+
|
|
8
|
+
You do **not** install any package. The app injects a small bridge into your page; you paste one
|
|
9
|
+
file (below) that talks to it.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
your page → window.HimalayaWorker → the app's companion worker → native iOS / Android
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Before you start: what the app owner must enable
|
|
16
|
+
|
|
17
|
+
Your page can only use capabilities the **app owner** turned on for your site. In a Brandy app
|
|
18
|
+
that is the `webSdk` block of the app's provisioning file:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"webSdk": {
|
|
23
|
+
"bundle": "my-site-capabilities",
|
|
24
|
+
"capabilities": ["health", "haptic"],
|
|
25
|
+
"permissionCopy": {
|
|
26
|
+
"health": "Show your daily steps and save the workouts you finish."
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- `capabilities` — the capability ids your page will call (see the
|
|
33
|
+
[Web page SDK reference](https://apps.wix.com/_api/himi-serve/docs/web-page-sdk-reference.md) for every id and method).
|
|
34
|
+
- `permissionCopy` — the sentence the phone shows when it asks the user for permission. Write it
|
|
35
|
+
for the end user, about what *they* get.
|
|
36
|
+
- `bundle` — the app's companion worker, which allowlists exactly which methods your page may
|
|
37
|
+
call. A health-only site can omit it; any other set needs one.
|
|
38
|
+
|
|
39
|
+
When you hand work to the app owner, give them the list as `capability.method` pairs, for example
|
|
40
|
+
`health.availability`, `health.requestPermission`, `health.query`, `haptic.play`. A method that is
|
|
41
|
+
not on the allowlist never answers — your call times out (see *Errors*).
|
|
42
|
+
|
|
43
|
+
Your page must be served from the site origin the app was built for. Pages in iframes, and pages
|
|
44
|
+
reached through a redirect to another origin, do not get the bridge.
|
|
45
|
+
|
|
46
|
+
## Step 1 — add the client file
|
|
47
|
+
|
|
48
|
+
Create `src/lib/himalaya.ts` with exactly this content. It has no dependencies and works with
|
|
49
|
+
React, Vue, Svelte or plain JavaScript callers. It is TypeScript: Vite-based projects (including
|
|
50
|
+
Lovable and Base44) compile it as is; a project with no TypeScript build step needs it compiled to
|
|
51
|
+
JavaScript first (for example with `npx -p typescript tsc --target es2020 --module esnext himalaya.ts`).
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// himalaya.ts — call native Himi app capabilities from a web page. No dependencies.
|
|
55
|
+
// Protocol v1: the page posts {v, id, capability, method, args}; the app answers {v, id, ok, result | error}.
|
|
56
|
+
|
|
57
|
+
type Bridge = { post(message: unknown): boolean; onMessage(handler: (message: unknown) => void): void };
|
|
58
|
+
type Reply = { v: 1; id: string; ok: boolean; result?: unknown; error?: { message: string; code?: string } };
|
|
59
|
+
|
|
60
|
+
export class HimalayaError extends Error {
|
|
61
|
+
/** "not_in_app" | "bridge_refused" | "timeout", or the capability's own code (e.g. "not_authorized"). */
|
|
62
|
+
readonly code: string;
|
|
63
|
+
constructor(message: string, code: string) {
|
|
64
|
+
super(message);
|
|
65
|
+
this.name = "HimalayaError";
|
|
66
|
+
this.code = code;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const pending = new Map<string, { resolve(value: unknown): void; reject(error: Error): void; timer: ReturnType<typeof setTimeout> }>();
|
|
71
|
+
let listeningOn: Bridge | undefined;
|
|
72
|
+
let counter = 0;
|
|
73
|
+
|
|
74
|
+
function bridge(): Bridge | undefined {
|
|
75
|
+
const candidate = (globalThis as { HimalayaWorker?: Bridge }).HimalayaWorker;
|
|
76
|
+
if (!candidate || typeof candidate.post !== "function" || typeof candidate.onMessage !== "function") return undefined;
|
|
77
|
+
if (listeningOn !== candidate) {
|
|
78
|
+
candidate.onMessage((message) => {
|
|
79
|
+
const reply = message as Reply;
|
|
80
|
+
if (!reply || reply.v !== 1 || typeof reply.id !== "string" || typeof reply.ok !== "boolean") return;
|
|
81
|
+
const call = pending.get(reply.id);
|
|
82
|
+
if (!call) return;
|
|
83
|
+
pending.delete(reply.id);
|
|
84
|
+
clearTimeout(call.timer);
|
|
85
|
+
if (reply.ok) call.resolve(reply.result);
|
|
86
|
+
else call.reject(new HimalayaError(reply.error?.message ?? "Native call failed", reply.error?.code ?? "failed"));
|
|
87
|
+
});
|
|
88
|
+
listeningOn = candidate;
|
|
89
|
+
}
|
|
90
|
+
return candidate;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** True when the page is running inside a Himi app WebView (false in a normal browser). */
|
|
94
|
+
export function isInHimiApp(): boolean {
|
|
95
|
+
return bridge() !== undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Call one native method, e.g. call("health", "query", [{ type: "steps", from, to }]). */
|
|
99
|
+
export function call<T = unknown>(capability: string, method: string, args: unknown[] = [], timeoutMs = 30_000): Promise<T> {
|
|
100
|
+
const target = bridge();
|
|
101
|
+
if (!target) return Promise.reject(new HimalayaError("Not running inside a Himi app", "not_in_app"));
|
|
102
|
+
const id = `page-${Date.now().toString(36)}-${++counter}`;
|
|
103
|
+
return new Promise<T>((resolve, reject) => {
|
|
104
|
+
const timer = setTimeout(() => {
|
|
105
|
+
pending.delete(id);
|
|
106
|
+
reject(new HimalayaError(`${capability}.${method} did not answer — is it enabled for this site?`, "timeout"));
|
|
107
|
+
}, timeoutMs);
|
|
108
|
+
pending.set(id, { resolve: resolve as (value: unknown) => void, reject, timer });
|
|
109
|
+
if (!target.post({ v: 1, id, capability, method, args })) {
|
|
110
|
+
clearTimeout(timer);
|
|
111
|
+
pending.delete(id);
|
|
112
|
+
reject(new HimalayaError("The app refused the message (too large or too frequent)", "bridge_refused"));
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** True when `capability.method` answers within `timeoutMs`. Use a read-only method. */
|
|
118
|
+
export async function isEnabled(capability: string, method: string, args: unknown[] = [], timeoutMs = 3_000): Promise<boolean> {
|
|
119
|
+
try {
|
|
120
|
+
await call(capability, method, args, timeoutMs);
|
|
121
|
+
return true;
|
|
122
|
+
} catch (error) {
|
|
123
|
+
// Only an answer from the app (even an error) proves the method is enabled.
|
|
124
|
+
return !(error instanceof HimalayaError && ["timeout", "not_in_app", "bridge_refused"].includes(error.code));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type Namespace = { [method: string]: ((...args: any[]) => Promise<any>) & Namespace };
|
|
129
|
+
|
|
130
|
+
function member(capability: string, path: string[]): Namespace {
|
|
131
|
+
return new Proxy(function () {} as unknown as Namespace, {
|
|
132
|
+
get: (_target, key) => (typeof key === "string" && key !== "then" ? member(capability, [...path, key]) : undefined),
|
|
133
|
+
apply: (_target, _this, args: unknown[]) => call(capability, path.join("."), args),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** himalaya.<capability>.<method>(...args), e.g. himalaya.haptic.play("success"). Always returns a Promise. */
|
|
138
|
+
export const himalaya = new Proxy({} as Record<string, Namespace>, {
|
|
139
|
+
get: (_target, key) => (typeof key === "string" && key !== "then" ? member(key, []) : undefined),
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Keep it as an ES module (`import` / `export`). In a classic `<script>` tag, do not create a global
|
|
144
|
+
named `himalaya` — the app already defines a read-only `window.himalaya`.
|
|
145
|
+
|
|
146
|
+
## Step 2 — call a capability
|
|
147
|
+
|
|
148
|
+
Capability ids are snake_case (`health`, `haptic`, `secure_storage`, `local_database`); method
|
|
149
|
+
names are exactly the SDK's function names. Arguments and results are plain JSON.
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import { himalaya, HimalayaError } from "./lib/himalaya";
|
|
153
|
+
|
|
154
|
+
// Light, fire-and-forget feedback.
|
|
155
|
+
await himalaya.haptic.play("success");
|
|
156
|
+
|
|
157
|
+
// Health: check, ask (from a button tap), then read.
|
|
158
|
+
const { available } = await himalaya.health.availability();
|
|
159
|
+
if (available) {
|
|
160
|
+
await himalaya.health.requestPermission({ read: ["steps"] });
|
|
161
|
+
const midnight = new Date();
|
|
162
|
+
midnight.setHours(0, 0, 0, 0);
|
|
163
|
+
const { samples } = await himalaya.health.query({
|
|
164
|
+
type: "steps",
|
|
165
|
+
from: midnight.toISOString(),
|
|
166
|
+
to: new Date().toISOString(),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
`call("health", "availability")` is the same thing without the proxy, and is handy when the
|
|
172
|
+
capability or method name is a variable.
|
|
173
|
+
|
|
174
|
+
## Step 3 — React pattern
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import { useEffect, useState } from "react";
|
|
178
|
+
import { call, himalaya, isInHimiApp, HimalayaError } from "./lib/himalaya";
|
|
179
|
+
|
|
180
|
+
export function StepsCard() {
|
|
181
|
+
const [state, setState] = useState<"checking" | "browser" | "off" | "ready" | "denied" | "failed">("checking");
|
|
182
|
+
const [steps, setSteps] = useState<number | null>(null);
|
|
183
|
+
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
if (!isInHimiApp()) return setState("browser");
|
|
186
|
+
// Answering is not enough: a phone without a health store answers { available: false }.
|
|
187
|
+
call<{ available: boolean }>("health", "availability", [], 3_000)
|
|
188
|
+
.then(({ available }) => setState(available ? "ready" : "off"))
|
|
189
|
+
// Not enabled for this site (timeout) hides the feature; any other failure offers a retry.
|
|
190
|
+
.catch((error) => setState(error instanceof HimalayaError && error.code === "timeout" ? "off" : "failed"));
|
|
191
|
+
}, []);
|
|
192
|
+
|
|
193
|
+
async function connect() {
|
|
194
|
+
try {
|
|
195
|
+
await himalaya.health.requestPermission({ read: ["steps"] });
|
|
196
|
+
const from = new Date(); from.setHours(0, 0, 0, 0);
|
|
197
|
+
const { samples } = await himalaya.health.query({ type: "steps", from: from.toISOString(), to: new Date().toISOString() });
|
|
198
|
+
setSteps(samples.reduce((sum: number, s: { value: number }) => sum + s.value, 0));
|
|
199
|
+
await himalaya.haptic.play("success").catch(() => {});
|
|
200
|
+
} catch (error) {
|
|
201
|
+
// Every outcome gets a state: a click handler that rethrows leaves an unhandled rejection.
|
|
202
|
+
const code = error instanceof HimalayaError ? error.code : "failed";
|
|
203
|
+
setState(code === "not_authorized" ? "denied" : code === "timeout" || code === "unavailable" ? "off" : "failed");
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (state === "checking") return null;
|
|
208
|
+
if (state === "browser") return <p>Open this page in our app to see your steps.</p>;
|
|
209
|
+
if (state === "off") return null; // no health store, or Health not enabled for this site — hide it
|
|
210
|
+
if (state === "denied") return <p>Health access is off. You can turn it on in your phone's Settings.</p>;
|
|
211
|
+
if (state === "failed") return <button onClick={connect}>Couldn't load your steps — try again</button>;
|
|
212
|
+
return steps === null ? <button onClick={connect}>Show today's steps</button> : <p>{steps} steps today</p>;
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The same page must keep working in an ordinary browser (and in Base44 / Lovable previews): check
|
|
217
|
+
`isInHimiApp()` and render a fallback instead of calling.
|
|
218
|
+
|
|
219
|
+
## Rules that keep a page working
|
|
220
|
+
|
|
221
|
+
- **Ask for permission only from a user action** (a button tap), after explaining the benefit on
|
|
222
|
+
screen. Never prompt on page load.
|
|
223
|
+
- **Handle "no" and "not available".** Every permission can be denied; Health may not exist on the
|
|
224
|
+
device (`availability()` tells you). Show a calm fallback, not an error.
|
|
225
|
+
- **Hide features the app doesn't enable.** Probe once with `isEnabled(...)` on a read-only method
|
|
226
|
+
and hide the UI when it is `false`. `true` only means the method is enabled — still read its
|
|
227
|
+
answer (`availability()` can say `{ available: false }`).
|
|
228
|
+
- **Plain JSON only.** Arguments and results cross as JSON: no functions, `Date` objects (use ISO
|
|
229
|
+
strings), `Blob`s or class instances. At most 12 arguments; keep each message under 1 MB.
|
|
230
|
+
- **Don't flood the bridge.** About 50 messages per second is the ceiling; debounce sliders and
|
|
231
|
+
scroll handlers.
|
|
232
|
+
- **Request/response only.** Methods that return a stream (`AsyncIterable`) or take a callback are
|
|
233
|
+
not callable from a page — the reference marks them. Poll a read method instead, or ask the
|
|
234
|
+
app owner for a page-friendly method.
|
|
235
|
+
- **Never put secrets in the page.** The page is public web code; native calls are authorized by
|
|
236
|
+
the app, not by anything you send.
|
|
237
|
+
|
|
238
|
+
## Errors
|
|
239
|
+
|
|
240
|
+
Every failure rejects with a `HimalayaError` that has a `code`:
|
|
241
|
+
|
|
242
|
+
| `code` | Meaning | What to do |
|
|
243
|
+
|---|---|---|
|
|
244
|
+
| `not_in_app` | Ordinary browser or preview, no bridge | Render the browser fallback |
|
|
245
|
+
| `timeout` | No answer: capability or method not enabled for this site, or not on this app build | Hide the feature; ask the app owner to enable `capability.method` |
|
|
246
|
+
| `bridge_refused` | Message too large or too frequent | Send less, less often |
|
|
247
|
+
| `not_authorized` | The user denied permission | Explain how to enable it in Settings |
|
|
248
|
+
| `unavailable` | Not supported on this device | Hide the feature |
|
|
249
|
+
| `invalid_argument` | Wrong argument shape | Fix the call — check the reference |
|
|
250
|
+
| `failed` / other | The native call failed | Show a retry |
|
|
251
|
+
|
|
252
|
+
Codes other than the first three come from the capability itself; its reference page lists them.
|
|
253
|
+
|
|
254
|
+
## Test it
|
|
255
|
+
|
|
256
|
+
- **In a browser** — `isInHimiApp()` is `false`; confirm your fallback renders.
|
|
257
|
+
- **With a fake bridge** — for unit tests or a design preview, install a fake before your app code
|
|
258
|
+
runs:
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
const answers: Record<string, unknown> = {
|
|
262
|
+
"health.availability": { available: true },
|
|
263
|
+
"health.requestPermission": undefined,
|
|
264
|
+
"health.query": { samples: [{ value: 4200 }] },
|
|
265
|
+
"haptic.play": undefined,
|
|
266
|
+
};
|
|
267
|
+
let reply: (message: unknown) => void = () => {};
|
|
268
|
+
(window as any).HimalayaWorker = {
|
|
269
|
+
post: (m: any) => (setTimeout(() => reply({ v: 1, id: m.id, ok: true, result: answers[`${m.capability}.${m.method}`] })), true),
|
|
270
|
+
onMessage: (handler: (message: unknown) => void) => { reply = handler; },
|
|
271
|
+
};
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Never ship the fake: a page that defines `HimalayaWorker` itself is lying to its own feature
|
|
275
|
+
checks.
|
|
276
|
+
- **On a phone** — open the page inside the app build the owner configured. Check each feature
|
|
277
|
+
once with permission granted and once denied.
|
|
278
|
+
|
|
279
|
+
## Reference
|
|
280
|
+
|
|
281
|
+
- [Web page SDK reference](https://apps.wix.com/_api/himi-serve/docs/web-page-sdk-reference.md) — every capability id and the methods a
|
|
282
|
+
page can call, with signatures.
|
|
283
|
+
- Per-package pages (type definitions and examples; long declarations are abridged there, the
|
|
284
|
+
reference above lists every callable signature in full): `https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2F<package>`,
|
|
285
|
+
for example [health](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fhealth) and
|
|
286
|
+
[haptic](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fhaptic).
|
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
# Web page SDK reference
|
|
2
|
+
|
|
3
|
+
Every native capability a web page hosted inside a Himi app can call, and each method's signature
|
|
4
|
+
as the page calls it. How to call them — the client file, permissions, errors, testing — is in
|
|
5
|
+
*Call native device features from a web page inside a Himi app*
|
|
6
|
+
([web-page-native-sdk](https://apps.wix.com/_api/himi-serve/docs/web-page-native-sdk.md)).
|
|
7
|
+
|
|
8
|
+
A capability or method listed here is callable only when the app owner enabled it for your site;
|
|
9
|
+
otherwise the call times out. Arguments and results are JSON: `Date` values travel as ISO
|
|
10
|
+
strings. Each section ends with the package's functions a page cannot call — local helpers, and
|
|
11
|
+
methods that return a live object, take a callback or push events. Generated from the SDK sources, so it matches the shipped SDKs.
|
|
12
|
+
|
|
13
|
+
## `app_info`
|
|
14
|
+
|
|
15
|
+
Tier-5 typed binding for this app's OWN build + OTA metadata. Package `@himalaya/app-info` — type definitions and examples (long declarations abridged; the signatures below are complete): [app-info](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fapp-info).
|
|
16
|
+
|
|
17
|
+
- `himalaya.app_info.get(): Promise<AppInfo>`
|
|
18
|
+
Read this app's build + OTA metadata from the host.
|
|
19
|
+
- `himalaya.app_info.displayVersion(): Promise<string>`
|
|
20
|
+
`"1.2.0 (34)"` — the conventional user-facing version string, or `"1.2.0"` when the build number is missing or identical to the version, and "" when there is no version at all.
|
|
21
|
+
|
|
22
|
+
## `audio_record`
|
|
23
|
+
|
|
24
|
+
Tier-5 typed binding for microphone recording. Package `@himalaya/audio-record` — type definitions and examples (long declarations abridged; the signatures below are complete): [audio-record](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Faudio-record).
|
|
25
|
+
|
|
26
|
+
- `himalaya.audio_record.getPermissionStatus(): Promise<PermissionStatus>`
|
|
27
|
+
- `himalaya.audio_record.requestPermission(): Promise<PermissionStatus>`
|
|
28
|
+
- `himalaya.audio_record.start(options?: { maxSeconds?: number }): Promise<{ started: boolean }>`
|
|
29
|
+
Begin recording.
|
|
30
|
+
- `himalaya.audio_record.stop(): Promise<AudioRecording | null>`
|
|
31
|
+
Stop recording and resolve the saved file (substrate FileHandle), or null if nothing was recorded.
|
|
32
|
+
- `himalaya.audio_record.pause(): Promise<{ paused: boolean }>`
|
|
33
|
+
Pause an in-progress recording; the same file resumes accumulating.
|
|
34
|
+
- `himalaya.audio_record.resume(): Promise<{ resumed: boolean }>`
|
|
35
|
+
Resume a paused recording into the same file.
|
|
36
|
+
- `himalaya.audio_record.cancel(): Promise<{ cancelled: boolean }>`
|
|
37
|
+
Stop and discard the in-progress recording.
|
|
38
|
+
- `himalaya.audio_record.startSession(options: { mode?: RecordingMode; chunkSeconds?: number } = {}): Promise<RecordingSession | null>`
|
|
39
|
+
Start a recoverable recording session.
|
|
40
|
+
- `himalaya.audio_record.getSession(sessionId: string): Promise<RecordingSession | null>`
|
|
41
|
+
- `himalaya.audio_record.listSessions(): Promise<RecordingSession[]>`
|
|
42
|
+
Enumerate persisted sessions so a worker can discover recoverable work after restart.
|
|
43
|
+
- `himalaya.audio_record.listSegments(sessionId: string, afterSequence = -1): Promise<RecordingSegment[]>`
|
|
44
|
+
- `himalaya.audio_record.stopSession(sessionId: string): Promise<RecordingSession | null>`
|
|
45
|
+
- `himalaya.audio_record.cancelSession(sessionId: string): Promise<boolean>`
|
|
46
|
+
- `himalaya.audio_record.watchStart(sessionId: string, afterSequence = -1): Promise<string | null>`
|
|
47
|
+
- `himalaya.audio_record.watchNext(watchId: string, timeoutMs = 30_000): Promise<RecordingWatchEvent>`
|
|
48
|
+
- `himalaya.audio_record.watchStop(watchId: string): Promise<void>`
|
|
49
|
+
|
|
50
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `subscribeLevel`.
|
|
51
|
+
|
|
52
|
+
## `base44`
|
|
53
|
+
|
|
54
|
+
Tier-5 typed binding for a Base44 app's backend. Package `@himalaya/base44` — type definitions and examples (long declarations abridged; the signatures below are complete): [base44](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fbase44).
|
|
55
|
+
|
|
56
|
+
- `himalaya.base44.auth.loginViaEmailPassword(email: string, password: string): Promise<LoginResult>`
|
|
57
|
+
Sign in with email + password.
|
|
58
|
+
- `himalaya.base44.auth.loginWithProvider(provider: AuthProvider = "google"): Promise<LoginResult>`
|
|
59
|
+
Sign in with a provider using the native system browser.
|
|
60
|
+
- `himalaya.base44.auth.register(email: string, password: string): Promise<JsonObject>`
|
|
61
|
+
- `himalaya.base44.auth.loginViaOtp(email: string): Promise<JsonObject>`
|
|
62
|
+
Send a one-time login code to `email`.
|
|
63
|
+
- `himalaya.base44.auth.verifyOtp(email: string, otpCode: string): Promise<LoginResult>`
|
|
64
|
+
Verify the one-time code.
|
|
65
|
+
- `himalaya.base44.auth.resetPassword(email: string): Promise<void>`
|
|
66
|
+
Request a password-reset email.
|
|
67
|
+
- `himalaya.base44.auth.me(): Promise<Base44User>`
|
|
68
|
+
- `himalaya.base44.auth.updateMe(patch: JsonObject): Promise<Base44User>`
|
|
69
|
+
- `himalaya.base44.auth.status(): Promise<AuthStatus>`
|
|
70
|
+
Whether a user is signed in, and who.
|
|
71
|
+
- `himalaya.base44.auth.logout(): Promise<void>`
|
|
72
|
+
Drop the stored token.
|
|
73
|
+
- `himalaya.base44.functions.invoke(name: string, data: JsonObject = {}): Promise<Json>`
|
|
74
|
+
Invoke a Base44 backend function by name.
|
|
75
|
+
|
|
76
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `base44Error`, `isBase44Error`, `toBase44Error`, `entities`.
|
|
77
|
+
|
|
78
|
+
## `biometrics`
|
|
79
|
+
|
|
80
|
+
Tier-5 typed binding to the platform's biometric authentication capability. Package `@himalaya/biometrics` — type definitions and examples (long declarations abridged; the signatures below are complete): [biometrics](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fbiometrics).
|
|
81
|
+
|
|
82
|
+
- `himalaya.biometrics.available(): Promise<BiometricKind>`
|
|
83
|
+
Returns the kind of biometric the device supports.
|
|
84
|
+
- `himalaya.biometrics.confirm(options: ConfirmOptions): Promise<boolean>`
|
|
85
|
+
Ask the system to authenticate the user.
|
|
86
|
+
|
|
87
|
+
## `browser_auth`
|
|
88
|
+
|
|
89
|
+
Tier-5 typed binding for native browser SSO. Package `@himalaya/browser-auth` — type definitions and examples (long declarations abridged; the signatures below are complete): [browser-auth](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fbrowser-auth).
|
|
90
|
+
|
|
91
|
+
- `himalaya.browser_auth.start(options: BrowserAuthOptions): Promise<BrowserAuthResult>`
|
|
92
|
+
|
|
93
|
+
## `calendar`
|
|
94
|
+
|
|
95
|
+
Tier-5 typed binding for the device calendar. Package `@himalaya/calendar` — type definitions and examples (long declarations abridged; the signatures below are complete): [calendar](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fcalendar).
|
|
96
|
+
|
|
97
|
+
- `himalaya.calendar.getPermissionStatus(): Promise<PermissionStatus>`
|
|
98
|
+
- `himalaya.calendar.requestPermission(access: CalendarAccess = "full"): Promise<PermissionStatus>`
|
|
99
|
+
Prompt for calendar access.
|
|
100
|
+
- `himalaya.calendar.listEvents(start: number, end: number): Promise<CalendarEvent[]>`
|
|
101
|
+
Events overlapping [start, end) (epoch ms).
|
|
102
|
+
- `himalaya.calendar.createEvent(event: NewCalendarEvent): Promise<{ id: string | null }>`
|
|
103
|
+
- `himalaya.calendar.updateEvent(id: string, patch: Partial<NewCalendarEvent>): Promise<{ updated: boolean }>`
|
|
104
|
+
- `himalaya.calendar.deleteEvent(id: string): Promise<{ deleted: boolean }>`
|
|
105
|
+
|
|
106
|
+
## `calls`
|
|
107
|
+
|
|
108
|
+
Tier-5 typed binding for real-time 1:1 audio calls (Stage 1). Package `@himalaya/calls` — type definitions and examples (long declarations abridged; the signatures below are complete): [calls](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fcalls).
|
|
109
|
+
|
|
110
|
+
- `himalaya.calls.availability(): Promise<AvailabilityReport>`
|
|
111
|
+
Whether this host can place a call at all (spec R8).
|
|
112
|
+
- `himalaya.calls.getPermissionStatus(): Promise<PermissionStatus>`
|
|
113
|
+
- `himalaya.calls.requestPermission(): Promise<PermissionStatus>`
|
|
114
|
+
- `himalaya.calls.start(opts: { peerId: string; iceServers?: readonly IceServer[] }): Promise<CallState | null>`
|
|
115
|
+
Place a call.
|
|
116
|
+
- `himalaya.calls.offer(opts: { callId: string; peerId: string; signal: string; iceServers?: readonly IceServer[]; }): Promise<CallState | null>`
|
|
117
|
+
An inbound offer arrived over the worker's own channel.
|
|
118
|
+
- `himalaya.calls.answer(opts: { callId: string; iceServers?: readonly IceServer[] }): Promise<CallState | null>`
|
|
119
|
+
Accept a ringing call.
|
|
120
|
+
- `himalaya.calls.reject(opts: { callId: string }): Promise<CallState | null>`
|
|
121
|
+
Decline a ringing call.
|
|
122
|
+
- `himalaya.calls.hangup(opts: { callId: string }): Promise<CallState | null>`
|
|
123
|
+
End a call.
|
|
124
|
+
- `himalaya.calls.receiveSignal(opts: { callId: string; signal: string }): Promise<CallState | null>`
|
|
125
|
+
Feed the peer's opaque blob back in.
|
|
126
|
+
- `himalaya.calls.setMuted(opts: { callId: string; muted: boolean }): Promise<CallState | null>`
|
|
127
|
+
- `himalaya.calls.setSpeaker(opts: { callId: string; route: CallRoute }): Promise<CallState | null>`
|
|
128
|
+
- `himalaya.calls.getState(opts: { callId: string }): Promise<CallState | null>`
|
|
129
|
+
- `himalaya.calls.listCalls(): Promise<CallState[]>`
|
|
130
|
+
Every live call.
|
|
131
|
+
- `himalaya.calls.signalStart(opts: { callId: string; afterSequence?: number }): Promise<string | null>`
|
|
132
|
+
Open the LOSSLESS outbound-signal queue.
|
|
133
|
+
- `himalaya.calls.signalNext(opts: { watchId: string; timeoutMs?: number }): Promise<OutboundSignal>`
|
|
134
|
+
Park until the next outbound signal.
|
|
135
|
+
- `himalaya.calls.signalStop(opts: { watchId: string }): Promise<void>`
|
|
136
|
+
|
|
137
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `configureRelays`, `configuredRelays`, `hasRelay`, `lastCallOfferedRelay`, `relaysFromJson`, `resolveIceServers`, `callStateFrom`, `describeEndReason`, `subscribeEvents`.
|
|
138
|
+
|
|
139
|
+
## `camera`
|
|
140
|
+
|
|
141
|
+
Tier-5 typed binding to the platform's camera capability. Package `@himalaya/camera` — type definitions and examples (long declarations abridged; the signatures below are complete): [camera](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fcamera).
|
|
142
|
+
|
|
143
|
+
- `himalaya.camera.capturePhoto(options: CaptureOptions): Promise<CapturedAsset | null>`
|
|
144
|
+
Capture a photo from the device camera or library.
|
|
145
|
+
- `himalaya.camera.pickDocument(): Promise<PickedDocument | null>`
|
|
146
|
+
Present the system document picker (iOS UIDocumentPicker / Android SAF).
|
|
147
|
+
- `himalaya.camera.scanQR(): Promise<string | null>`
|
|
148
|
+
Present a full-screen QR scanner (iOS AVFoundation; camera-based).
|
|
149
|
+
|
|
150
|
+
## `clipboard`
|
|
151
|
+
|
|
152
|
+
Tier-5 typed binding for the system clipboard. Package `@himalaya/clipboard` — type definitions and examples (long declarations abridged; the signatures below are complete): [clipboard](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fclipboard).
|
|
153
|
+
|
|
154
|
+
- `himalaya.clipboard.writeText(text: string): Promise<void>`
|
|
155
|
+
Copy `text` to the clipboard.
|
|
156
|
+
- `himalaya.clipboard.readText(): Promise<string | null>`
|
|
157
|
+
Read the clipboard's text, or null if empty / the read was blocked (no focus, denied permission).
|
|
158
|
+
- `himalaya.clipboard.hasText(): Promise<boolean>`
|
|
159
|
+
Whether the clipboard holds text — no content access, no iOS paste banner.
|
|
160
|
+
|
|
161
|
+
## `contacts`
|
|
162
|
+
|
|
163
|
+
Tier-5 typed binding for the device address book. Package `@himalaya/contacts` — type definitions and examples (long declarations abridged; the signatures below are complete): [contacts](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fcontacts).
|
|
164
|
+
|
|
165
|
+
- `himalaya.contacts.pick(): Promise<Contact | null>`
|
|
166
|
+
Present the OS contact picker (no permission).
|
|
167
|
+
- `himalaya.contacts.getPermissionStatus(): Promise<PermissionStatus>`
|
|
168
|
+
- `himalaya.contacts.requestPermission(): Promise<PermissionStatus>`
|
|
169
|
+
- `himalaya.contacts.search(query: string, limit?: number): Promise<Contact[]>`
|
|
170
|
+
Search contacts by name (requires read permission).
|
|
171
|
+
|
|
172
|
+
## `file_picker`
|
|
173
|
+
|
|
174
|
+
Tier-5 typed binding for user-mediated document access OUTSIDE the app sandbox. Package `@himalaya/file-picker` — type definitions and examples (long declarations abridged; the signatures below are complete): [file-picker](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Ffile-picker).
|
|
175
|
+
|
|
176
|
+
- `himalaya.file_picker.pick(options?: FilePickOptions): Promise<FileHandle[]>`
|
|
177
|
+
Present the OS document picker.
|
|
178
|
+
- `himalaya.file_picker.pickDirectoryForExport(file: FileHandle | string): Promise<{ exported: boolean }>`
|
|
179
|
+
Export a substrate file out to a user-chosen location (save/export picker).
|
|
180
|
+
|
|
181
|
+
## `files`
|
|
182
|
+
|
|
183
|
+
Tier-5 typed binding for app-scoped document storage. Package `@himalaya/files` — type definitions and examples (long declarations abridged; the signatures below are complete): [files](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Ffiles).
|
|
184
|
+
|
|
185
|
+
- `himalaya.files.write( path: string, content: string | { base64: string }, opts?: { mimeType?: string }, ): Promise<FileHandle>`
|
|
186
|
+
Write text or base64 bytes to `path` (relative to the app's bundle_docs root).
|
|
187
|
+
- `himalaya.files.readText(ref: FileHandle | string): Promise<string>`
|
|
188
|
+
Read a file's contents as a UTF-8 string.
|
|
189
|
+
- `himalaya.files.readBase64(ref: FileHandle | string): Promise<string>`
|
|
190
|
+
Read a file's contents as base64.
|
|
191
|
+
- `himalaya.files.list(dirPath?: string): Promise<FileStat[]>`
|
|
192
|
+
List the files under `dirPath` (relative to bundle_docs; omit for the root).
|
|
193
|
+
- `himalaya.files.remove(ref: FileHandle | string): Promise<void>`
|
|
194
|
+
Delete a file.
|
|
195
|
+
- `himalaya.files.stat(path: string): Promise<FileStat | null>`
|
|
196
|
+
Stat a path, or `null` if it doesn't exist (the existence check for handles).
|
|
197
|
+
|
|
198
|
+
## `godot`
|
|
199
|
+
|
|
200
|
+
Tier-5 typed binding for a Godot game surface. Package `@himalaya/godot` — type definitions and examples (long declarations abridged; the signatures below are complete): [godot](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fgodot).
|
|
201
|
+
|
|
202
|
+
- `himalaya.godot.send( sessionId: GameSessionId, message: Record<string, unknown>, ): Promise<void>`
|
|
203
|
+
Send a message to the running game (worker -> game).
|
|
204
|
+
- `himalaya.godot.loadPack( sessionId: GameSessionId, pack: GamePack, ): Promise<PackResult>`
|
|
205
|
+
Fetch, verify, and mount a content pack into the running engine.
|
|
206
|
+
- `himalaya.godot.release(sessionId: GameSessionId): Promise<void>`
|
|
207
|
+
Release the game surface's engine/GPU resources.
|
|
208
|
+
|
|
209
|
+
## `haptic`
|
|
210
|
+
|
|
211
|
+
Tier-5 typed binding for the platform's haptic capability. Package `@himalaya/haptic` — type definitions and examples (long declarations abridged; the signatures below are complete): [haptic](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fhaptic).
|
|
212
|
+
|
|
213
|
+
- `himalaya.haptic.play(pattern: HapticPattern = "light"): Promise<void>`
|
|
214
|
+
Play a haptic feedback pattern.
|
|
215
|
+
|
|
216
|
+
## `health`
|
|
217
|
+
|
|
218
|
+
Tier-5 typed binding for the platform HEALTH store. Package `@himalaya/health` — type definitions and examples (long declarations abridged; the signatures below are complete): [health](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fhealth).
|
|
219
|
+
|
|
220
|
+
- `himalaya.health.availability(): Promise<HealthAvailability>`
|
|
221
|
+
Whether this device has a health store the app can reach.
|
|
222
|
+
- `himalaya.health.requestPermission(p: { read: HealthType[]; write?: HealthWriteType[] }): Promise<{ granted: HealthType[] }>`
|
|
223
|
+
Prompt for read (and optionally write) access.
|
|
224
|
+
- `himalaya.health.getPermissionStatus(p: { types: HealthType[] }): Promise<Record<HealthType, HealthPermissionState>>`
|
|
225
|
+
Current READ permission per type, without prompting.
|
|
226
|
+
- `himalaya.health.query(p: HealthQuery): Promise<{ samples: HealthSample[] }>`
|
|
227
|
+
Read samples of one type over [from, to).
|
|
228
|
+
- `himalaya.health.saveWorkout(w: Workout): Promise<{ id: string }>`
|
|
229
|
+
Save a completed workout (with its energy/distance, when given).
|
|
230
|
+
|
|
231
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `healthError`, `isHealthError`.
|
|
232
|
+
|
|
233
|
+
## `himi_apps`
|
|
234
|
+
|
|
235
|
+
Tier-5 typed binding for cross-app open / host queries. Package `@himalaya/himi-apps` — type definitions and examples (long declarations abridged; the signatures below are complete): [himi-apps](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fhimi-apps).
|
|
236
|
+
|
|
237
|
+
- `himalaya.himi_apps.open(args: OpenArgs): Promise<OpenResult>`
|
|
238
|
+
Open another Himi app (switch or handoff depending on host).
|
|
239
|
+
- `himalaya.himi_apps.canOpen(appId: string): Promise<boolean>`
|
|
240
|
+
Whether the host can open `appId` (registry / handoff availability).
|
|
241
|
+
- `himalaya.himi_apps.current(): Promise<{ appId: string } | null>`
|
|
242
|
+
Active host app id, or null when unknown.
|
|
243
|
+
- `himalaya.himi_apps.hostInfo(): Promise<HostInfo>`
|
|
244
|
+
Host kind + whether handoff URLs are supported.
|
|
245
|
+
|
|
246
|
+
## `iap`
|
|
247
|
+
|
|
248
|
+
Tier-5 typed binding to the platform's in-app-purchase capability. Package `@himalaya/iap` — type definitions and examples (long declarations abridged; the signatures below are complete): [iap](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fiap).
|
|
249
|
+
|
|
250
|
+
- `himalaya.iap.getPaywallConfig(): Promise<PaywallConfig>`
|
|
251
|
+
Fetch the server-configured paywall (the OTA `iapConfig`) with each product resolved against the store.
|
|
252
|
+
- `himalaya.iap.getProducts(productIds: string[]): Promise<Product[]>`
|
|
253
|
+
Look up store metadata (localized title/price/etc.) for the given product ids.
|
|
254
|
+
- `himalaya.iap.purchase(productId: string): Promise<PurchaseResult>`
|
|
255
|
+
Start a purchase for `productId` and resolve once the store flow completes.
|
|
256
|
+
- `himalaya.iap.restore(): Promise<Entitlement[]>`
|
|
257
|
+
Restore prior purchases (iOS `AppStore.sync()` / Android `queryPurchasesAsync`) and resolve with the current entitlements.
|
|
258
|
+
- `himalaya.iap.entitlements(): Promise<Entitlement[]>`
|
|
259
|
+
The user's current active entitlements, verified on-device.
|
|
260
|
+
- `himalaya.iap.consume(transactionId: string): Promise<boolean>`
|
|
261
|
+
Finish a consumable purchase (iOS `Transaction.finish` / Android `consumeAsync`) AFTER the worker has granted the balance, so the user can purchase it again.
|
|
262
|
+
- `himalaya.iap.purchaseForVerification(input: { productId: string; appAccountToken: string }): Promise<VerificationPurchaseResult>`
|
|
263
|
+
Apple non-consumables only.
|
|
264
|
+
- `himalaya.iap.getUnfinishedTransactions(): Promise<UnfinishedTransactionsResult>`
|
|
265
|
+
Same-install recovery; does not restore finished purchases or override ownership.
|
|
266
|
+
- `himalaya.iap.finishTransaction(input: { transactionId: string }): Promise<FinishTransactionResult>`
|
|
267
|
+
Trusted callers must first obtain durable backend processing acknowledgement.
|
|
268
|
+
|
|
269
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `createPurchaseCoordinator`, `createPricingController`, `createIapCatalogPricing`, `iapPriceFields`, `onlineProgramItem`, `createWixIapClient`.
|
|
270
|
+
|
|
271
|
+
## `keyboard`
|
|
272
|
+
|
|
273
|
+
Tier-5 typed binding for the platform's keyboard capability. Package `@himalaya/keyboard` — type definitions and examples (long declarations abridged; the signatures below are complete): [keyboard](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fkeyboard).
|
|
274
|
+
|
|
275
|
+
- `himalaya.keyboard.dismiss(): Promise<void>`
|
|
276
|
+
Dismiss the software keyboard.
|
|
277
|
+
|
|
278
|
+
## `live_activity`
|
|
279
|
+
|
|
280
|
+
Tier-5 typed binding to the platform's Live Activity capability. Package `@himalaya/live-activity` — type definitions and examples (long declarations abridged; the signatures below are complete): [live-activity](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Flive-activity).
|
|
281
|
+
|
|
282
|
+
- `himalaya.live_activity.start(options: StartOptions): Promise<StartResult>`
|
|
283
|
+
Start a Live Activity.
|
|
284
|
+
- `himalaya.live_activity.update(options: UpdateOptions): Promise<void>`
|
|
285
|
+
Update a running activity's rendered content.
|
|
286
|
+
- `himalaya.live_activity.end(options: EndOptions): Promise<void>`
|
|
287
|
+
End a running activity (optionally showing one last frame).
|
|
288
|
+
|
|
289
|
+
## `local_database`
|
|
290
|
+
|
|
291
|
+
Tier-5 typed binding to the platform's local-database capability: a per-entity on-device store (EntityStore) + an offline WriteQueue, so a worker bundle can persist and query real data on device. Package `@himalaya/local-db` — type definitions and examples (long declarations abridged; the signatures below are complete): [local-db](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Flocal-db).
|
|
292
|
+
|
|
293
|
+
- `himalaya.local_database.availability(): Promise<Availability>`
|
|
294
|
+
Whether this host actually backs the local database.
|
|
295
|
+
- `himalaya.local_database.getAll(entity: string): Promise<DbEntity[]>`
|
|
296
|
+
All rows of a collection (empty array if none).
|
|
297
|
+
- `himalaya.local_database.get(entity: string, id: string): Promise<DbEntity | null>`
|
|
298
|
+
One row by `id`, or null.
|
|
299
|
+
- `himalaya.local_database.upsert(entity: string, object: DbEntity): Promise<void>`
|
|
300
|
+
Insert or replace a row (matched by its `id`).
|
|
301
|
+
- `himalaya.local_database.remove(entity: string, id: string): Promise<void>`
|
|
302
|
+
Remove a row by `id` (no-op if missing).
|
|
303
|
+
- `himalaya.local_database.purge(entity: string): Promise<void>`
|
|
304
|
+
Drop the whole collection.
|
|
305
|
+
- `himalaya.local_database.query(entity: string, q: LocalQuery = {}): Promise<DbEntity[]>`
|
|
306
|
+
Rows of a collection matching `q` (filter + sort + paginate), evaluated on device.
|
|
307
|
+
- `himalaya.local_database.count(entity: string, q: LocalQuery = {}): Promise<number>`
|
|
308
|
+
Number of rows matching `q` (ignores limit/offset).
|
|
309
|
+
- `himalaya.local_database.enqueue(actionId: string, params: Record<string, string | number | boolean> = {}): Promise<void>`
|
|
310
|
+
Queue an offline mutation to replay later.
|
|
311
|
+
- `himalaya.local_database.queueDepth(): Promise<number>`
|
|
312
|
+
Number of queued writes.
|
|
313
|
+
- `himalaya.local_database.drainQueue(): Promise<number>`
|
|
314
|
+
Drain (clear) the queue; returns how many writes were drained.
|
|
315
|
+
|
|
316
|
+
## `location`
|
|
317
|
+
|
|
318
|
+
Tier-5 typed binding for device location. Package `@himalaya/location` — type definitions and examples (long declarations abridged; the signatures below are complete): [location](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Flocation).
|
|
319
|
+
|
|
320
|
+
- `himalaya.location.getPermissionStatus(): Promise<PermissionStatus>`
|
|
321
|
+
- `himalaya.location.requestPermission(options?: { background?: boolean }): Promise<PermissionStatus>`
|
|
322
|
+
Prompt for location access.
|
|
323
|
+
- `himalaya.location.getCurrent(options?: { accuracy?: LocationAccuracy; timeoutMs?: number }): Promise<Position | null>`
|
|
324
|
+
One-shot current position, or null (denied / timed out / unavailable).
|
|
325
|
+
- `himalaya.location.startBackgroundTracking(): Promise<void>`
|
|
326
|
+
Keep location delivery alive while the app is backgrounded, so an open `watch()` keeps recording with the screen off.
|
|
327
|
+
- `himalaya.location.stopBackgroundTracking(): Promise<void>`
|
|
328
|
+
Stop background delivery.
|
|
329
|
+
- `himalaya.location.regionMonitoringSupport(): Promise<RegionMonitoringSupport>`
|
|
330
|
+
What the OS can do here, on THIS device.
|
|
331
|
+
- `himalaya.location.addMonitoredRegion(fence: Geofence): Promise<MonitoredRegionResult>`
|
|
332
|
+
Hand a region to the OS.
|
|
333
|
+
- `himalaya.location.removeMonitoredRegion(id: string): Promise<boolean>`
|
|
334
|
+
Stop monitoring one region.
|
|
335
|
+
- `himalaya.location.monitoredRegions(): Promise<Geofence[]>`
|
|
336
|
+
What the OS is monitoring for this app right now.
|
|
337
|
+
- `himalaya.location.clearMonitoredRegions(): Promise<void>`
|
|
338
|
+
Stop monitoring everything.
|
|
339
|
+
|
|
340
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `watch`, `distanceMeters`, `createGeofenceMonitor`, `watchGeofences`, `watchMonitoredRegions`.
|
|
341
|
+
|
|
342
|
+
## `media_playback`
|
|
343
|
+
|
|
344
|
+
Tier-5 typed binding for background-capable media playback and offline downloads. Package `@himalaya/media-playback` — type definitions and examples (long declarations abridged; the signatures below are complete): [media-playback](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fmedia-playback).
|
|
345
|
+
|
|
346
|
+
- `himalaya.media_playback.play(ref: MediaSessionRef): Promise<void>`
|
|
347
|
+
- `himalaya.media_playback.play(item?: MediaQueueItem): Promise<MediaPlaybackStatus>`
|
|
348
|
+
- `himalaya.media_playback.pause(ref: MediaSessionRef): Promise<void>`
|
|
349
|
+
- `himalaya.media_playback.pause(): Promise<MediaPlaybackStatus>`
|
|
350
|
+
- `himalaya.media_playback.stop(ref: MediaSessionRef): Promise<void>`
|
|
351
|
+
- `himalaya.media_playback.seek(positionMs: number): Promise<MediaPlaybackStatus>`
|
|
352
|
+
- `himalaya.media_playback.seekTo(ref: MediaSessionRef & { positionSeconds: number }): Promise<void>`
|
|
353
|
+
- `himalaya.media_playback.skip(delta: number): Promise<MediaPlaybackStatus>`
|
|
354
|
+
- `himalaya.media_playback.next(ref: MediaSessionRef): Promise<void>`
|
|
355
|
+
- `himalaya.media_playback.previous(ref: MediaSessionRef): Promise<void>`
|
|
356
|
+
- `himalaya.media_playback.setRate(ref: MediaSessionRef & { rate: number }): Promise<void>`
|
|
357
|
+
- `himalaya.media_playback.setRate(rate: number): Promise<MediaPlaybackStatus>`
|
|
358
|
+
- `himalaya.media_playback.setMuted(ref: MediaSessionRef & { muted: boolean }): Promise<void>`
|
|
359
|
+
- `himalaya.media_playback.presentFullscreen(ref: MediaSessionRef): Promise<void>`
|
|
360
|
+
- `himalaya.media_playback.pictureInPicture(ref: MediaSessionRef): Promise<{ started: boolean }>`
|
|
361
|
+
- `himalaya.media_playback.getState(ref: MediaSessionRef): Promise<MediaPlaybackState | null>`
|
|
362
|
+
- `himalaya.media_playback.getCapabilities(ref: MediaSessionRef): Promise<MediaPlaybackCapabilities>`
|
|
363
|
+
- `himalaya.media_playback.release(ref: MediaSessionRef): Promise<void>`
|
|
364
|
+
- `himalaya.media_playback.status(): Promise<MediaPlaybackStatus>`
|
|
365
|
+
- `himalaya.media_playback.download(item: MediaQueueItem): Promise<MediaDownloadResult>`
|
|
366
|
+
- `himalaya.media_playback.removeDownload(id: string): Promise<MediaDownloadResult>`
|
|
367
|
+
|
|
368
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `setQueue`, `encodeSessionOptions`, `subscribeStatus`, `unsubscribeStatus`.
|
|
369
|
+
|
|
370
|
+
## `motion`
|
|
371
|
+
|
|
372
|
+
Tier-5 typed binding for the device's motion sensors. Package `@himalaya/motion` — type definitions and examples (long declarations abridged; the signatures below are complete): [motion](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fmotion).
|
|
373
|
+
|
|
374
|
+
- `himalaya.motion.getPermissionStatus(): Promise<PermissionStatus>`
|
|
375
|
+
Motion permission status.
|
|
376
|
+
- `himalaya.motion.requestPermission(): Promise<PermissionStatus>`
|
|
377
|
+
Prompt for motion access (step counting).
|
|
378
|
+
- `himalaya.motion.availability(): Promise<MotionAvailability>`
|
|
379
|
+
Which sensors this device has.
|
|
380
|
+
- `himalaya.motion.openStepHistorySetup(): Promise<boolean>`
|
|
381
|
+
Take the user to whatever would make `stepHistory` "available": on Android, update Google Play services (`needs_setup`) or grant step access (`needs_permission`).
|
|
382
|
+
- `himalaya.motion.getStepCount(fromMs: number, toMs: number): Promise<number | null>`
|
|
383
|
+
Steps between two epoch-ms instants — HISTORICAL, so it can answer "how many steps today" even though the app was not running.
|
|
384
|
+
- `himalaya.motion.getAltitude(): Promise<AltitudeSample | null>`
|
|
385
|
+
One barometric reading.
|
|
386
|
+
- `himalaya.motion.getHeading(): Promise<HeadingSample | null>`
|
|
387
|
+
One compass reading, or null when there is no magnetometer / no permission.
|
|
388
|
+
|
|
389
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `watch`.
|
|
390
|
+
|
|
391
|
+
## `on_device_ai`
|
|
392
|
+
|
|
393
|
+
Tier-5 typed binding for ON-DEVICE text generation. Package `@himalaya/on-device-ai` — type definitions and examples (long declarations abridged; the signatures below are complete): [on-device-ai](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fon-device-ai).
|
|
394
|
+
|
|
395
|
+
- `himalaya.on_device_ai.availability(): Promise<OnDeviceAvailability>`
|
|
396
|
+
Probe on-device text-generation support on this device/host BEFORE calling `generateText` (spec R8), so a bundle branches instead of rendering a dead button.
|
|
397
|
+
- `himalaya.on_device_ai.generateText(input: GenerateTextInput): Promise<GenerateTextResult>`
|
|
398
|
+
Generate text ON DEVICE from a prompt, returning a schema-conforming JSON string.
|
|
399
|
+
- `himalaya.on_device_ai.generateJson<T = Record<string, unknown>>(input: GenerateTextInput): Promise<T | null>`
|
|
400
|
+
Generate text on device and parse it against its schema, returning the typed object (or null on unavailable / failure / unparseable output).
|
|
401
|
+
- `himalaya.on_device_ai.summarize(text: string, opts: SummarizeOptions = {}): Promise<GenerateTextResult>`
|
|
402
|
+
Summarize a block of text on device.
|
|
403
|
+
|
|
404
|
+
## `open_url`
|
|
405
|
+
|
|
406
|
+
Tier-5 typed binding for opening links + external apps. Package `@himalaya/open-url` — type definitions and examples (long declarations abridged; the signatures below are complete): [open-url](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fopen-url).
|
|
407
|
+
|
|
408
|
+
- `himalaya.open_url.open(url: string, mode?: OpenMode): Promise<{ opened: boolean }>`
|
|
409
|
+
Open `url`.
|
|
410
|
+
- `himalaya.open_url.canOpen(url: string): Promise<boolean>`
|
|
411
|
+
True if a handler exists for `url`.
|
|
412
|
+
|
|
413
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `defaultMode`.
|
|
414
|
+
|
|
415
|
+
## `pdf`
|
|
416
|
+
|
|
417
|
+
Tier-5 typed binding for viewing PDF documents. Package `@himalaya/pdf` — type definitions and examples (long declarations abridged; the signatures below are complete): [pdf](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fpdf).
|
|
418
|
+
|
|
419
|
+
- `himalaya.pdf.isAvailable(): Promise<Availability>`
|
|
420
|
+
Whether this device can display a PDF in-app right now.
|
|
421
|
+
- `himalaya.pdf.open(url: string, options: OpenPdfOptions = {}): Promise<OpenPdfResult>`
|
|
422
|
+
Present `url` in a document viewer.
|
|
423
|
+
|
|
424
|
+
## `photos`
|
|
425
|
+
|
|
426
|
+
Tier-5 typed binding for the photo library (picker-first). Package `@himalaya/photos` — type definitions and examples (long declarations abridged; the signatures below are complete): [photos](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fphotos).
|
|
427
|
+
|
|
428
|
+
- `himalaya.photos.pick(options?: PickOptions): Promise<FileHandle[]>`
|
|
429
|
+
Present the OS photo picker (no permission).
|
|
430
|
+
- `himalaya.photos.saveToLibrary(file: FileHandle | string): Promise<{ saved: boolean }>`
|
|
431
|
+
Save a file (from files/camera/etc.) into the user's photo library.
|
|
432
|
+
- `himalaya.photos.getSavePermissionStatus(): Promise<PermissionStatus>`
|
|
433
|
+
Add-to-library permission status (no prompt).
|
|
434
|
+
|
|
435
|
+
## `presigned_upload`
|
|
436
|
+
|
|
437
|
+
Tier-5 typed binding for a RAW binary upload to a pre-signed, self-authorizing URL. Package `@himalaya/presigned-upload` — type definitions and examples (long declarations abridged; the signatures below are complete): [presigned-upload](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fpresigned-upload).
|
|
438
|
+
|
|
439
|
+
- `himalaya.presigned_upload.put(url: string, bytes: { base64: string }, opts?: UploadOptions): Promise<UploadResult>`
|
|
440
|
+
Upload base64-encoded bytes to a pre-signed URL.
|
|
441
|
+
- `himalaya.presigned_upload.putFile( url: string, ref: FileHandle | string, opts?: UploadOptions, ): Promise<UploadResult>`
|
|
442
|
+
Upload a stored file's bytes to a pre-signed URL, read straight from the `@himalaya/files` substrate — the bytes never cross the worker bridge, so this is the path for photos and voice notes.
|
|
443
|
+
|
|
444
|
+
## `push`
|
|
445
|
+
|
|
446
|
+
Tier-5 typed binding to the platform's push capability. Package `@himalaya/push` — type definitions and examples (long declarations abridged; the signatures below are complete): [push](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fpush).
|
|
447
|
+
|
|
448
|
+
- `himalaya.push.getPermissionStatus(): Promise<PushPermission>`
|
|
449
|
+
Current OS notification-permission status (no prompt).
|
|
450
|
+
- `himalaya.push.requestPermission(): Promise<PushPermission>`
|
|
451
|
+
Request the OS notification permission, prompting if still undetermined.
|
|
452
|
+
- `himalaya.push.openSettings(): Promise<boolean>`
|
|
453
|
+
Open this app's notification settings in the OS (iOS 16+: the app's Notifications pane; Android 8+: the app's notification settings; earlier: the app's settings page).
|
|
454
|
+
- `himalaya.push.scheduleLocal(options: ScheduleLocalOptions): Promise<{ id: string }>`
|
|
455
|
+
Schedule a local (on-device) notification.
|
|
456
|
+
- `himalaya.push.cancelLocal(id: string): Promise<void>`
|
|
457
|
+
Cancel a pending local notification by id.
|
|
458
|
+
- `himalaya.push.cancelAllLocal(): Promise<void>`
|
|
459
|
+
Cancel every pending local notification this app scheduled.
|
|
460
|
+
- `himalaya.push.setBadge(count: number): Promise<void>`
|
|
461
|
+
Set the app-icon badge count ("the pimple").
|
|
462
|
+
- `himalaya.push.clearBadge(): Promise<void>`
|
|
463
|
+
Clear the app-icon badge — exactly `setBadge(0)`.
|
|
464
|
+
- `himalaya.push.getBadge(): Promise<number>`
|
|
465
|
+
Read the current app-icon badge count.
|
|
466
|
+
- `himalaya.push.getDeviceToken(): Promise<string | null>`
|
|
467
|
+
The registered remote device token (APNs hex / FCM token), or null if the app has not registered for remote notifications yet.
|
|
468
|
+
- `himalaya.push.listDelivered(): Promise<DeliveredNotification[]>`
|
|
469
|
+
Notifications currently shown in the system tray / notification center.
|
|
470
|
+
- `himalaya.push.clearDelivered(ids?: string[]): Promise<void>`
|
|
471
|
+
Remove delivered notifications.
|
|
472
|
+
|
|
473
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `readNotificationEvent`.
|
|
474
|
+
|
|
475
|
+
## `release_control`
|
|
476
|
+
|
|
477
|
+
Tier-5 typed binding for the on-device OTA release picker. Package `@himalaya/release-control` — type definitions and examples (long declarations abridged; the signatures below are complete): [release-control](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Frelease-control).
|
|
478
|
+
|
|
479
|
+
- `himalaya.release_control.available(): Promise<boolean>`
|
|
480
|
+
Whether this host exposes the release picker at all.
|
|
481
|
+
- `himalaya.release_control.active(): Promise<ActiveRelease>`
|
|
482
|
+
The release currently being served, and what decided it.
|
|
483
|
+
- `himalaya.release_control.list(): Promise<ReleaseList>`
|
|
484
|
+
Published releases for this app, newest first, from serve-control's public trimmed history.
|
|
485
|
+
- `himalaya.release_control.select(releaseId: string | null, opts: SelectOptions = {}): Promise<SelectResult>`
|
|
486
|
+
Pin this install to `releaseId`, or pass null to clear the pin and follow the rollout ring again ("reset to latest").
|
|
487
|
+
- `himalaya.release_control.resetToLatest(): Promise<SelectResult>`
|
|
488
|
+
Clear the pin and follow the rollout ring again.
|
|
489
|
+
|
|
490
|
+
## `secure_storage`
|
|
491
|
+
|
|
492
|
+
Tier-5 typed binding to the platform's secure-storage capability. Package `@himalaya/secure-storage` — type definitions and examples (long declarations abridged; the signatures below are complete): [secure-storage](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fsecure-storage).
|
|
493
|
+
|
|
494
|
+
- `himalaya.secure_storage.availability(): Promise<Availability>`
|
|
495
|
+
Whether this host actually backs secure storage.
|
|
496
|
+
- `himalaya.secure_storage.read(key: string): Promise<string | null>`
|
|
497
|
+
Read a previously stored value.
|
|
498
|
+
- `himalaya.secure_storage.write( key: string, value: string, options: WriteOptions = {} ): Promise<void>`
|
|
499
|
+
Persist a value under `key`.
|
|
500
|
+
- `himalaya.secure_storage.remove(key: string): Promise<void>`
|
|
501
|
+
Remove a key.
|
|
502
|
+
|
|
503
|
+
## `share`
|
|
504
|
+
|
|
505
|
+
Tier-5 typed binding for the system share sheet. Package `@himalaya/share` — type definitions and examples (long declarations abridged; the signatures below are complete): [share](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fshare).
|
|
506
|
+
|
|
507
|
+
- `himalaya.share.share(options: ShareOptions): Promise<{ completed: boolean }>`
|
|
508
|
+
Resolves `{ completed: true }` when the user completed a share action, or `{ completed: false }` when they dismissed the sheet or the host degraded (e.g.
|
|
509
|
+
- `himalaya.share.availability(): Promise<Availability>`
|
|
510
|
+
Whether the share sheet is available on this host: `full` (native / Web Share API present), `degraded` (web fallback — copies url/text to the clipboard and reports `completed:false`), or `unavailable`.
|
|
511
|
+
|
|
512
|
+
## `speaker_diarization`
|
|
513
|
+
|
|
514
|
+
anonymous speaker segmentation only. Package `@himalaya/speaker-diarization` — type definitions and examples (long declarations abridged; the signatures below are complete): [speaker-diarization](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fspeaker-diarization).
|
|
515
|
+
|
|
516
|
+
- `himalaya.speaker_diarization.availability(): Promise<DiarizationAvailability>`
|
|
517
|
+
- `himalaya.speaker_diarization.analyzeFile(file: FileHandle): Promise<DiarizationResult>`
|
|
518
|
+
|
|
519
|
+
## `speech`
|
|
520
|
+
|
|
521
|
+
Tier-5 typed binding to the platform's speech capability. Package `@himalaya/speech` — type definitions and examples (long declarations abridged; the signatures below are complete): [speech](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fspeech).
|
|
522
|
+
|
|
523
|
+
- `himalaya.speech.recognizeOnce(options: RecognizeOptions = {}): Promise<RecognizeResult>`
|
|
524
|
+
Record from the microphone and transcribe a single utterance.
|
|
525
|
+
- `himalaya.speech.speak(options: SpeakOptions): Promise<void>`
|
|
526
|
+
Speak `text` aloud via the platform speech synthesizer.
|
|
527
|
+
- `himalaya.speech.stop(): Promise<void>`
|
|
528
|
+
Cancel any in-flight recognition and stop any in-flight synthesis.
|
|
529
|
+
- `himalaya.speech.availability(): Promise<SpeechAvailability>`
|
|
530
|
+
- `himalaya.speech.transcribeFile(file: FileHandle, options: { language?: string } = {}): Promise<TranscriptResult>`
|
|
531
|
+
- `himalaya.speech.streamStart(options: { sessionId: string; language?: string }): Promise<string | null>`
|
|
532
|
+
- `himalaya.speech.streamNext(streamId: string, timeoutMs = 30_000): Promise<SpeechStreamEvent>`
|
|
533
|
+
- `himalaya.speech.streamStop(streamId: string): Promise<void>`
|
|
534
|
+
|
|
535
|
+
## `system_intents`
|
|
536
|
+
|
|
537
|
+
Tier-5 typed binding to the platform's system-intents capability. Package `@himalaya/system-intents` — type definitions and examples (long declarations abridged; the signatures below are complete): [system-intents](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fsystem-intents).
|
|
538
|
+
|
|
539
|
+
- `himalaya.system_intents.donate(options: DonateOptions): Promise<DonateResult>`
|
|
540
|
+
Donate a screen to the OS assistant for proactive suggestions.
|
|
541
|
+
- `himalaya.system_intents.refreshShortcuts(): Promise<void>`
|
|
542
|
+
Re-publish the suggested App Shortcuts (e.g.
|
|
543
|
+
|
|
544
|
+
## `tasks`
|
|
545
|
+
|
|
546
|
+
Tier-5 typed binding for reminders / to-dos. Package `@himalaya/tasks` — type definitions and examples (long declarations abridged; the signatures below are complete): [tasks](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Ftasks).
|
|
547
|
+
|
|
548
|
+
- `himalaya.tasks.backend(): Promise<TasksBackend>`
|
|
549
|
+
Which backend serves this platform — "reminders" (iOS) or "local" (Android).
|
|
550
|
+
- `himalaya.tasks.getPermissionStatus(): Promise<PermissionStatus>`
|
|
551
|
+
- `himalaya.tasks.requestPermission(): Promise<PermissionStatus>`
|
|
552
|
+
- `himalaya.tasks.list(): Promise<Task[]>`
|
|
553
|
+
- `himalaya.tasks.create(task: { title: string; due?: number; notes?: string }): Promise<{ id: string | null }>`
|
|
554
|
+
- `himalaya.tasks.setCompleted(id: string, completed: boolean): Promise<{ updated: boolean }>`
|
|
555
|
+
- `himalaya.tasks.remove(id: string): Promise<{ removed: boolean }>`
|
|
556
|
+
|
|
557
|
+
## `ui`
|
|
558
|
+
|
|
559
|
+
Tier-5 typed binding to the platform's imperative popup capability. Package `@himalaya/ui` — type definitions and examples (long declarations abridged; the signatures below are complete): [ui](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fui).
|
|
560
|
+
|
|
561
|
+
- `himalaya.ui.alert(options: AlertOptions): Promise<AlertResult>`
|
|
562
|
+
Present a modal alert on the current screen.
|
|
563
|
+
- `himalaya.ui.snackbar(options: SnackbarOptions): Promise<void>`
|
|
564
|
+
Show a transient snackbar toast.
|
|
565
|
+
|
|
566
|
+
## `wix_cashier`
|
|
567
|
+
|
|
568
|
+
Tier-5 typed binding to the platform's native cashier. Package `@himalaya/wix-cashier` — type definitions and examples (long declarations abridged; the signatures below are complete): [wix-cashier](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fwix-cashier).
|
|
569
|
+
|
|
570
|
+
- `himalaya.wix_cashier.isAvailable(): Promise<Availability>`
|
|
571
|
+
Whether the device can collect payment natively right now — i.e.
|
|
572
|
+
- `himalaya.wix_cashier.proceedToPayment(config: PaymentConfig): Promise<PaymentResult>`
|
|
573
|
+
Present the native cashier for one order and resolve with the settlement result.
|
|
574
|
+
|
|
575
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `normalizeStatus`.
|
|
576
|
+
|
|
577
|
+
## `wix_platform`
|
|
578
|
+
|
|
579
|
+
Wix Platform SDK, worker-facing bindings. Package `@himalaya/wix-platform` — type definitions and examples (long declarations abridged; the signatures below are complete): [wix-platform](https://apps.wix.com/_api/himi-serve/authoring/resource/sdks%2Fwix-platform).
|
|
580
|
+
|
|
581
|
+
- `himalaya.wix_platform.bi.track(evid: number | string, params?: Record<string, string | number>): Promise<BiResult>`
|
|
582
|
+
Fire a BI beacon with an explicit Frog `evid` + params.
|
|
583
|
+
- `himalaya.wix_platform.bi.pageView(pageName: string): Promise<BiResult>`
|
|
584
|
+
Page-view beacon (Frog evid 501).
|
|
585
|
+
- `himalaya.wix_platform.bi.click(buttonName: string, pageName?: string): Promise<BiResult>`
|
|
586
|
+
Click beacon (Frog evid 522).
|
|
587
|
+
- `himalaya.wix_platform.experiments.conduct(spec: string, fallback = "false"): Promise<ExperimentResult>`
|
|
588
|
+
The app's served variant for `spec` (`himi flags`), or `fallback` when none is assigned.
|
|
589
|
+
- `himalaya.wix_platform.experiments.isEnabled(spec: string): Promise<boolean>`
|
|
590
|
+
Boolean convenience — true when the variant is exactly "true".
|
|
591
|
+
- `himalaya.wix_platform.experiments.exposure(spec: string, variant: string): Promise<{ ok: boolean }>`
|
|
592
|
+
Report A/B exposure for `spec`/`variant` — emits the platform's `experiment_exposed` telemetry so outcome events attribute to the variant.
|
|
593
|
+
- `himalaya.wix_platform.flags.isEnabled(spec: string, fallback = false): Promise<boolean>`
|
|
594
|
+
Whether the app's served flag `spec` is ON (variant `on`/`true`/`new`), else `fallback`.
|
|
595
|
+
- `himalaya.wix_platform.flags.value(spec: string, fallback = ""): Promise<string>`
|
|
596
|
+
A toggle's raw value (variant string) for non-boolean specs.
|
|
597
|
+
- `himalaya.wix_platform.flags.all(): Promise<Record<string, string>>`
|
|
598
|
+
All known toggle states (dev/diagnostic).
|
|
599
|
+
- `himalaya.wix_platform.i18n.t(key: string, fallback?: string): Promise<string>`
|
|
600
|
+
Resolve a translation key for the current locale; `fallback` (or the key) when unknown.
|
|
601
|
+
- `himalaya.wix_platform.i18n.locale(): Promise<string>`
|
|
602
|
+
Current resolved UI locale (2-letter).
|
|
603
|
+
- `himalaya.wix_platform.ping.register(): Promise<PingRegistration>`
|
|
604
|
+
Register the device's push token with Wix Ping.
|
|
605
|
+
- `himalaya.wix_platform.ping.status(): Promise<PingRegistration>`
|
|
606
|
+
Current Ping registration status (no network).
|
|
607
|
+
- `himalaya.wix_platform.deeplink.resolveDeferred(): Promise<{ link: string | null }>`
|
|
608
|
+
Resolve a deferred (post-install) deep link via Wix Jot.
|
|
609
|
+
- `himalaya.wix_platform.session.headers(): Promise<Record<string, string>>`
|
|
610
|
+
The Wix mobile aspect-headers the transport attaches to wix-host requests (BSI, x-wix-language, mobile-app-version, x-wix-rpc-caller-id, …).
|
|
611
|
+
- `himalaya.wix_platform.session.signedInstanceStatus(): Promise<SignedInstanceStatus>`
|
|
612
|
+
Whether a per-business signed instance is minted, and for which metaSite.
|
|
613
|
+
- `himalaya.wix_platform.auth.getIdentity(): Promise<WixIdentity>`
|
|
614
|
+
Current identity (visitor vs member vs owner) + who.
|
|
615
|
+
- `himalaya.wix_platform.auth.isAuthenticated(): Promise<boolean>`
|
|
616
|
+
True when a member/owner is signed in.
|
|
617
|
+
- `himalaya.wix_platform.auth.getAccessToken(): Promise<string | null>`
|
|
618
|
+
The current access/member token (or null when anonymous).
|
|
619
|
+
- `himalaya.wix_platform.auth.signIn(): Promise<WixIdentity>`
|
|
620
|
+
Sign in (hosted Wix login → member token).
|
|
621
|
+
- `himalaya.wix_platform.auth.signOut(): Promise<WixIdentity>`
|
|
622
|
+
Sign out — clears the member token (visitor session may persist).
|
|
623
|
+
- `himalaya.wix_platform.auth.signedInstance(businessId: string, type: WixSignedInstanceType = "User"): Promise<string | null>`
|
|
624
|
+
Mint/return a per-business signed instance for authorized Wix REST calls — the ONE canonical worker-facing signed-instance accessor.
|
|
625
|
+
- `himalaya.wix_platform.site.setActiveSite(msid: string): Promise<{ ok: boolean; msid: string }>`
|
|
626
|
+
Scope to a business by metaSiteId; resolves after the per-site instance mints.
|
|
627
|
+
- `himalaya.wix_platform.site.activeSite(): Promise<string>`
|
|
628
|
+
The metaSiteId currently scoped ("" if none).
|
|
629
|
+
- `himalaya.wix_platform.site.getBusinessInfo(): Promise<WixBusinessInfo | null>`
|
|
630
|
+
The customer's business/site info (identity + locale + contact) from Wix Site Properties v4.
|
|
631
|
+
- `himalaya.wix_platform.monitoring.captureError(message: string, extra?: Record<string, string>): Promise<{ ok: boolean }>`
|
|
632
|
+
Capture a handled error message (routes to the Sentry telemetry sink).
|
|
633
|
+
- `himalaya.wix_platform.monitoring.captureException(errorClass: string, message: string, extra?: Record<string, string>): Promise<{ ok: boolean }>`
|
|
634
|
+
Capture an exception with an error class + message (crash-style report).
|
|
635
|
+
- `himalaya.wix_platform.monitoring.setUser(userId: string, traits?: Record<string, string>): Promise<void>`
|
|
636
|
+
Associate the current user with subsequent crash reports.
|
|
637
|
+
- `himalaya.wix_platform.monitoring.setTag(key: string, value: string): Promise<void>`
|
|
638
|
+
Set a scope tag attached to subsequent crash reports.
|
|
639
|
+
- `himalaya.wix_platform.monitoring.addBreadcrumb(message: string): Promise<void>`
|
|
640
|
+
Drop a breadcrumb onto the crash trail.
|
|
641
|
+
|
|
642
|
+
Not callable from a page (local helpers, live objects, callbacks or pushed events): `isMemberReal`, `site.forSite`.
|
|
@@ -14,7 +14,14 @@ allowlist it, its `logicBundle.declaredCapabilities` must name it, and the binar
|
|
|
14
14
|
|
|
15
15
|
## Page
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Building the page outside this platform's packages — in Base44, Lovable, Claude or any other web
|
|
18
|
+
stack? Use [Call native device features from a web page inside a Himi app](web-page-native-sdk.md)
|
|
19
|
+
instead: it has a dependency-free client you paste in, and the
|
|
20
|
+
[Web page SDK reference](https://apps.wix.com/_api/himi-serve/docs/web-page-sdk-reference.md)
|
|
21
|
+
lists every capability and method. The package below is for pages built with the platform's own
|
|
22
|
+
packages.
|
|
23
|
+
|
|
24
|
+
With `@wix/himalaya` installed, import its page entry:
|
|
18
25
|
|
|
19
26
|
```ts
|
|
20
27
|
import { himalaya } from "@wix/himalaya/webview-page";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1298.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"artifactId": "himalaya-cli"
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
"falconPackageHash": "
|
|
73
|
+
"falconPackageHash": "1df7cfb27386e9ed0596e19c100d0c17bf4ec0673aaa35086101644e"
|
|
74
74
|
}
|