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
| Example | Path | Covers |
|---|---|---|
| Node server route | packages/docs-examples/src/node-server.ts | Returning an Effect that validates requests and calls calculateReport from a server route. |
| Browser HTTP caller | packages/docs-examples/src/browser-http.ts | Returning an Effect that calls the typed HTTP client with canonical facts. |
| Effect request | packages/docs-examples/src/effect.ts | Constructing a calculateRunRequest program for an Effect application. |
| Error handling | packages/docs-examples/src/error-handling.ts | Reading 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.
- External input validation
- Typed calculator help
- Raw HTTP error envelope
- Fact definition
- Integration tests
Typecheck examples
Typecheck every checked example:
bun run --filter=@taxkit/docs-examples check-examplesThe 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.