Schemas

Use SDK schema exports when your application needs the canonical calculator run contracts or safe-result error shapes.

Import schemas

ts
import {
  CalculatorRunFacts,
  CalculatorRunRequest,
  CalculatorRunResponse,
  CalculatorRunServiceRequest,
  CalculatorServiceError,
} from "@taxkit/sdk/schemas";

These names are re-exported from the calculator package for consumer convenience. The calculator package remains the source of truth for the CalculatorRun* contracts and CalculatorServiceError.

Common contracts

NameUse
CalculatorRunFactsCanonical facts accepted by calculator runs.
CalculatorRunRequestPublic calculator run payload shape.
CalculatorRunServiceRequestService-level request with the calculator id.
CalculatorRunResponseCanonical run response shape.
CalculatorServiceErrorExpected calculator service failure union.

Safe-result schemas

The SDK also exports safe-result and error schemas:

ts
import {
  TaxKitClientDisposedError,
  TaxKitClientDisposeError,
  TaxKitFailure,
  TaxKitSchemaDecodeError,
  TaxKitSuccess,
} from "@taxkit/sdk/schemas";

Use these when you persist, inspect or validate results returned by TaxKit.safe.calculate. TaxKitClientDisposedError describes calculation calls after a client closes. TaxKitClientDisposeError describes a safe cleanup failure from dispose().