Skip to content

Credential connections and legacy networking

Use the global fetch API for HTTP requests in Lite Views, ordinary commands and backgrounds. Use connections when the host must store credentials and send an authenticated JSON request without exposing those credentials to plugin code; fetch does not inherit connection credentials. Connections are available in Views and ordinary actions, not backgrounds, and requests end with their caller. network.read is deprecated and retained only for existing plugins. New code uses fetch, including Range headers for byte-range requests. It follows browser.network or browser.networkOrigins grants, with an explicit whitelist taking precedence.

Usage guide: services. API index.

Signatures, parameters and return types are generated from the SDK. Optional members are not available in every host and context.

Deprecated

Source

Deprecated

Supported hosts: Lite

Deprecated. Use global fetch; for byte ranges, send a Range header and verify a 206 response before consuming it. Retained for compatibility with existing plugins.

read(request: {
url: string;
range?: {
offset: number;
length: number;
};
}): Promise<{
data: Uint8Array;
status: number;
etag?: string;
}>;
Parameter Type Required
request { url: string; range?: { offset: number; length: number; }; } Yes

Returns: Promise<{ data: Uint8Array; status: number; etag?: string; }>.

Source

Supported hosts: Lite Mobile

Check whether the user configured the declared connection.

isConfigured(connection: string): Promise<boolean>;
Parameter Type Required
connection string Yes

Returns: Promise<boolean>.

Supported hosts: Lite Mobile

Send a JSON request using host-managed connection credentials.

request(input: {
connection: string;
body: JsonObject;
}): Promise<JsonObject>;
Parameter Type Required
input { connection: string; body: JsonObject; } Yes

Returns: Promise<JsonObject>.