Examples

Use these examples when you want a short, typechecked file that exercises one public integration path. The files export Effect programs or handlers. Your application runtime decides how to run them.

Example files

ExamplePathCovers
Node server routepackages/docs-examples/src/node-server.tsReturning an Effect that validates requests and calls calculateReport from a server route.
Browser HTTP callerpackages/docs-examples/src/browser-http.tsReturning an Effect that calls the typed HTTP client with canonical facts.
Effect requestpackages/docs-examples/src/effect.tsConstructing a calculateRunRequest program for an Effect application.
Error handlingpackages/docs-examples/src/error-handling.tsReading a TaxKit.safe.calculate failure value.

The validation, calculator-help, fact-definition, integration-test and raw HTTP error guides also copy their complete TypeScript fences from checked example files. Authored-content validation rejects a fence that differs from its source.

Typecheck examples

Typecheck every checked example:

sh
bun run --filter=@taxkit/docs-examples check-examples

The browser HTTP example takes an explicit URL and uses the typed API client with FetchHttpClient.layer. The application host owns Effect execution and error handling; the example does not start a runtime.