Decide whether network access is appropriate
Do not use worker network access for:- secrets or credentials;
- OAuth flows;
- private endpoints;
- private API tokens;
- webhooks or background work.
Declare the capability
ImportnetworkAccess from the public worker facade and add it to the widget’s uses array.
Understand approval
A portal author must approve the exact package ID, package version, and capability version. Changing any of those values makes the prior grant stale. Interactive portal push requests approval. For a reviewed non-interactive push, use--allow-network-widgets. The general --yes flag does not grant network access.
Understand the request boundary
Granted fetch uses the worker’s native origin. Fluid does not add credentials, cookies, tokens, or headers. YourRequestInit, including credential mode, remains in effect.
Some destinations are always blocked, granted or not: the portal’s own address, fluid.app and its subdomains, localhost, and private IP addresses. To reach your own server on a Fluid address, such as a Mist app, use a portal function.
The grant doesn’t get around the browser’s CORS rules or the page’s Content Security Policy. Local preview and a deployed portal can apply different policies, so test every destination on the deployed portal before release.
A widget can send portal data it receives to an external service. Review both the package and its destinations before approval.