Skip to content
Documentation
1.0.0-beta.10 · latest

Canonical examples

Source e69e4b6f1381 · Published v1.0.0-beta.10

Each example includes a handler, project config and package metadata. Follow its README for executable checks: most use a pulse test harness; context MCP runs live tool requests against its compiled application/ project. The documentation lane verifies the shown CLI results and request evidence.

ExampleDemonstrates
01-hello-jsonRequest branching and JSON/text responses.
02-request-schemaExplicit request and response schemas.
03-fetch-compositionOne fetch, sequential composition, and explicit ctx.parallel concurrency.
05-fastly-capabilitiesConfig, secrets, KV, a named backend, and package-root GRIP broadcast.
07-opaque-proxyDirect binary/stream pass-through without body inspection.
09-router-loweringMounted routes, scoped terminal middleware, fallthrough, error transfer, parameters, wildcards, and entry-aware effects.
10-entities-toolsExperimental schema-bound entities, deterministic catalog discovery, JSON-RPC dispatch, and an external tools facade.
11-eventsStatic event ingress, schema/no-payload frames, exact outbound acceptance, and separate HTTP/event entries.
12-pulse-context-mcpA read-only MCP server for project starters, cited contracts, examples and diagnostic help.
13-jwt-es256ES256 bearer verification with an explicit guest-linked Native realization.

For build settings, see Native build optimization.

The Native rows show fresh default builds with Node 24.18.0 and lockfile-pinned AssemblyScript 0.28.18. Values are exact, uncompressed on-disk bytes. Portable guests and deployable provider modules are separate artifacts; the JWT guest is the final linked output.

ExampleDefault application guestDefault deployable Fastly module
01-hello-json2,273 bytes—
02-request-schema32,707 bytes—
03-fetch-composition4,572 bytes—
03-fetch-composition/dynamic-probes71,947 bytes—
05-fastly-capabilities5,181 bytes46,209 bytes
07-opaque-proxy2,205 bytes36,637 bytes
09-router-lowering7,407 bytes—
10-entities-toolsNo application Wasm—
11-events32,458 bytes—
12-pulse-context-mcpSee its Report (corpus-dependent)Explicit fastly-native profile
13-jwt-es25635,926 bytes—

Run the normal workflow from any example directory:

Terminal window
pulse doctor
pulse test
pulse dev
pulse build

Use pulse inspect to examine the plan before building. Most examples record fixed default byte counts verified by the docs gate. Context MCP instead reports its completed build: bundled corpus changes affect its size. See Project lifecycle.

Examples 01, 02, 03, 05, 07, 11, and 13 use current package-root application surfaces. Example 09 retains the lower-level Router surface. Examples 10 and 12 use the synchronized @pulse-compute/entities Beta package; executable examples do not themselves authorize publication. Example 11 is executable only through the Node JavaScript/Native reference adapter. It does not claim a public listener, delivery, or Fastly/browser/ESP32 event support; see Static events and outbound emission.

Example 12 serves five read-only MCP tools directly from application/, with Node Native, Node JavaScript and Fastly Native profiles. It uses a bundled corpus and requires no upstream server. Its README explains installation and shows the MCP endpoint and request helper.

Example 13 pins the guest-linked ES256 realization for Native. Its harness executes valid, invalid-signature, and disallowed-algorithm cases against the exact linked artifact; only the public P-256 JWK is included in the example.

This documented build is executed against the config/secret example and must produce the configured-provider native Fastly module. The portable compiler runs before the exact artifact crosses the provider boundary; the provider target receives no compiler service and does not invoke one.

Terminal window
pulse build --out .pulse-docs-build --json
{
"status": "built",
"provider": "fastly",
"manifest": {
"providerTarget": {
"sourceOnly": false,
"compiledWasmPresent": true,
"target": "fastly-compute-native",
"javascriptRuntime": false,
"compiler": {
"package": "assemblyscript",
"version": "0.28.18",
"invoked": false
},
"wasm": {
"file": "bin/main.wasm",
"magic": "0061736d01000000"
}
}
}
}

Fastly configured tests and pulse dev use the local-conformance runtime. The separate reality profile delegates execution of the native provider module to fastly compute serve.