Prerequisites
- A Veryfront project with
veryfront.config.ts. - For a first-party extension: the matching package installed.
- For a local extension: a folder under
extensions/with a default-exported factory (see Extension authoring).
Where extensions run
Extensions run wherever you run the project:veryfront dev, veryfront start, and any runtime you host yourself.
Veryfront Cloud is the exception. It reads a project’s configuration file as
data rather than importing it, so a configuration file that imports an
extension factory cannot be evaluated there. veryfront deploy refuses such a
configuration before it creates a release, and names the line it refused. Keep
a configuration file that Veryfront Cloud serves to literals and the
defineConfig, defineConfigWithEnv, getEnv and mergeConfigs helpers.
Enable an extension
Add extension factories toveryfront.config.ts:
veryfront.config.ts to force reload during development.
Authorize React Server Actions
Server Actions require an application-owned authorization provider. Create a local extension that publishes the provider through the active extension generation:403, and removing the provider makes the endpoint fail closed
with 503. Configure CSRF protection independently through security.csrf;
the authorization provider does not enable or replace it.
Server Action arguments must be JSON-compatible: finite primitives, dense
arrays, and plain records. Convert FormData, class instances, dates, and
other application objects before calling an action. Each request accepts at
most RSC_ACTION_MAX_TOP_LEVEL_ARGUMENTS top-level arguments; nested arrays
use the separately documented authorization snapshot bounds. See the
veryfront/extensions/auth reference
for the exact provider DTO, bounds, outcomes, timeout, cancellation, and
generation-retirement behavior.
Migrate from the legacy Server Action guard
The old import-map override atrendering/rsc/server-action-guard.ts is no longer consulted and its former
default allowed every action. Remove that override, publish
RscActionAuthorizationProviderName as shown above, and deploy the provider
with the framework upgrade. Until the active generation owns a valid provider,
Server Action requests intentionally return 503; there is no core allow-all
fallback.
Enable Node.js WebSocket upgrades
The standardveryfront npm/CLI distribution installs and auto-activates the
Node.js transport extension, including for local HMR. Custom Node service
distributions must install it alongside veryfront:
veryfront.config.ts entry is required. To disable the builtin when
WebSocket support is intentionally unavailable, use:
First-party extension areas
Veryfront applies explicit disable directives and higher-priority project
overrides before importing optional first-party built-ins. A package that is
not installed is skipped. An installed package that fails to load, returns an
invalid extension, or leaves a required contract unavailable stops activation;
the currently active extension generation remains in service until the
replacement passes preflight.
Verify it worked
Restartveryfront dev after changing extension configuration:
- The dev log should print a setup line for each loaded extension.
- Any contract the extension provides should now be resolvable through the
matching consumer. For example, setting
CACHE_TYPE=extensionlets the proxy use a registeredTokenCacheStoreto share OAuth tokens across processes without a core Redis dependency. - If the factory throws during setup, the dev server prints the setup error with the extension name. Fix the error and reload.