Pulse 1.0.0-beta.7 betaExact, immutable release documentation.Browse latest
Documentation platform maintainersactiveReviewed 2026-10-07Review by 2027-01-12

Canonical examples#

Every top-level example is a complete Pulse project with a handler, config, tests, TypeScript config, and package metadata. The executable documentation lane runs the documented doctor, inspect, test, and build workflows; it also starts the hello project with dev, sends a request, and verifies shutdown. The context MCP example additionally exercises its standalone host and client walkthroughs through the focused host test.

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.

Wasm size at a glance#

The Native rows compare the ordinary build with pulse build --experimental-native-size. Values are uncompressed on-disk sizes; each example page includes exact byte counts.

ExampleDefault Native WasmSize-optimized Native WasmReductionDeployable Fastly module
01-hello-json2.1 KiB2.0 KiB3.8%—
02-request-schema40.0 KiB31.8 KiB20.4%—
03-fetch-composition4.9 KiB4.2 KiB13.7%—
05-fastly-capabilities5.3 KiB4.8 KiB9.4%45.8 → 38.0 KiB
07-opaque-proxy2.1 KiB2.1 KiB4.5%33.9 → 29.2 KiB
09-router-lowering9.0 KiB8.4 KiB6.6%—
10-entities-tools——Not applicableJavaScript-first candidate
11-events39.6 KiB31.6 KiB20.2%—
12-pulse-context-mcp——Not applicableNode JavaScript
13-jwt-es25638.4 KiB38.2 KiB0.5%—

Run the normal workflow from any example directory:

pulse doctor
pulse test
pulse dev
pulse build

Use pulse inspect when you need to examine the plan; it is not required before build. Each example README contains exact source-bound handler/config blocks and executable evidence selected by the docs lane. Every page also records the default and experimental size-optimized Wasm outputs; Fastly pages separate the provider-neutral guest from the deployable module, and the JavaScript Entities and context MCP pages explicitly records that no comparable application Wasm is emitted. The same gate rebuilds and verifies every exact byte count. 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 selects Node JavaScript explicitly. Its built-in context needs no upstream server. Use its npm run build and npm start scripts for the MCP listener; pulse dev serves only the app's JSON-RPC boundary. The README records candidate dependency availability and the installed release qualification still required before registry installation is supported.

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.

Verified native Fastly build#

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.

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.

Browse other documentation