Skip to content

Interface: AppContext<Config> ​

Everything a call runs with. The host functions are synchronous from here: the host does the work while the module waits, so ctx.http(...) answers at once.

Type Parameters ​

Config ​

Config = unknown

Properties ​

callbackUrl? ​

ts
optional callbackUrl?: string;

Where the vendor must send webhooks for this app, when the deployment exposes one.


callId ​

ts
callId: string;

config ​

ts
config: Config;

The install's configuration, parsed with the manifest's configSchema (defaults applied).


documents ​

ts
documents: object;

read() ​

ts
read(documentId): AppDocument;
Parameters ​
documentId ​

string

Returns ​

AppDocument


idempotencyKey? ​

ts
optional idempotencyKey?: string;

Stable key for the logical call, the same across retries, when the caller gave one.


log ​

ts
log: AppLogger;

tenantId ​

ts
tenantId: string;

Methods ​

hmac() ​

ts
hmac(request): string;

Parameters ​

request ​

HmacRequest

Returns ​

string


hmacVerify() ​

ts
hmacVerify(request): boolean;

Parameters ​

request ​

HmacVerifyRequest

Returns ​

boolean


http() ​

ts
http(request): HttpResponse;

Parameters ​

request ​

HttpRequest

Returns ​

HttpResponse


secret() ​

ts
secret(name): `{{secret:${string}}}`;

The placeholder for a secret of the install; the module never sees the value.

Parameters ​

name ​

string

Returns ​

{{secret:${string}}}

Released under the Apache-2.0 License.