@wix/headless-node
v1.42.0
Published
Headless host and host module for backend.
Downloads
16,329
Maintainers
Keywords
Readme
@wix/headless-node
Headless host and host module for backend.
Usage
import { createClient, OAuthStrategy } from '@wix/sdk';
import { headlessNode, RequestType, ProjectType } from '@wix/headless-node';
const wixClient = createClient({
host: headlessNode.host({
monitoring: { requestType: RequestType.Web, projectType: ProjectType.Site },
}),
auth: OAuthStrategy({ clientId: '<your-client-id>' }),
modules: { headless: headlessNode },
});processResponse
Call wixClient.headless.processResponse(response) to decorate an outgoing Response with Wix monitoring / BI headers (auth token, request type, project type) before returning it to the caller.
await wixClient.headless.processResponse(response);Cloudflare
When this host is intended to be used in a Cloudflare environment, make sure the /workerd export path is bundled instead of the root. That export path ships Cloudflare-specific code.
