Scope extension
import * as mod from "jsr:@nzip/lofi/recipes/scope-extension";
Opt-in deployment helpers for reciprocal PWA scope extensions.
createScopeExtension
function
function createScopeExtension(origin: string): ScopeExtensionDeclaration
Create one validated manifest declaration without adding it to the starter.
createWebAppOriginAssociation
function
function createWebAppOriginAssociation(options: WebAppOriginAssociationOptions): Readonly<Record<string, WebAppOriginAssociationEntry>>
Create the JSON value for /.well-known/web-app-origin-association.
Deploy this file on the extending origin before adding its declaration to the primary app manifest.
verifyWebAppOriginAssociation
function
function verifyWebAppOriginAssociation(value: unknown, options: WebAppOriginAssociationOptions): boolean
Verify that unknown association JSON contains the exact manifest ID and scope.
Extra manifest entries are allowed, but the matched entry may contain only scope.
ScopeExtensionDeclaration
type
type ScopeExtensionDeclaration = {
readonly type: "origin";
readonly origin: string;
};
A manifest scope_extensions entry owned by this product.
WebAppOriginAssociationEntry
type
type WebAppOriginAssociationEntry = {
readonly scope: string;
};
The value published under an exact manifest ID in an origin association file.
WebAppOriginAssociationOptions
type
type WebAppOriginAssociationOptions = {
manifestId: string;
scope: string;
};
Options shared by association generation and verification.