SDK reference
Use this page when you need the stable SDK names after you have chosen an integration path.
Entry points
| Import | Use |
|---|---|
@taxkit/sdk | Use TaxKit.calculate, TaxKit.safe.calculate and TaxKit.createClient. |
@taxkit/sdk/au | Use Australian calculator helpers such as au.incomeTax.annual. |
@taxkit/sdk/effect | Use calculateRunRequest, calculateReportRequest, calculateReport and the Effect client helper. |
@taxkit/sdk/au/effect | Use Australian calculation descriptors in Effect programs. |
@taxkit/sdk/schemas | Import schema-facing types that are re-exported for SDK consumers. |
The SDK package remains private until release approval. The public import shape is still the developer contract used by docs and examples.
Plain SDK
Use TaxKit.calculate when you already have descriptor-typed input and want a
Promise for the report:
import { Cents, aud } from "@taxkit/core/primitives";
import { TaxKit } from "@taxkit/sdk";
import { au } from "@taxkit/sdk/au";
const report = await TaxKit.calculate(au.calculations.annualIncomeTax, {
taxableIncome: aud(Cents.make(9_000_000)),
});Use the AU helper when you do not need to pass the descriptor yourself:
import { Cents, aud } from "@taxkit/core/primitives";
import { au } from "@taxkit/sdk/au";
const report = await au.incomeTax.annual({
taxableIncome: aud(Cents.make(9_000_000)),
});Safe SDK
Use TaxKit.safe.calculate when expected calculator failures should be values:
import { Cents, aud } from "@taxkit/core/primitives";
import { TaxKit } from "@taxkit/sdk";
import { au } from "@taxkit/sdk/au";
const result = await TaxKit.safe.calculate(au.calculations.annualIncomeTax, {
taxableIncome: aud(Cents.make(9_000_000)),
});
if (result._tag === "TaxKitSuccess") {
console.log(result.value.liability.cents);
}Effect SDK
Use calculateRunRequest when you need a full CalculatorRunResponse with the
descriptor-decoded report:
import { audFromCents } from "@taxkit/core/primitives";
import { AuAnnualIncomeTaxCalculation } from "@taxkit/sdk/au/effect";
import { calculateRunRequest } from "@taxkit/sdk/effect";
import { Effect, Option } from "effect";
const effect = Effect.gen(function* () {
const taxableIncome = yield* audFromCents(9_000_000);
return yield* calculateRunRequest(AuAnnualIncomeTaxCalculation, {
payload: {
facts: { taxableIncome },
jurisdiction: Option.some(
Option.some(AuAnnualIncomeTaxCalculation.jurisdiction)
),
taxYear: Option.some(Option.some(AuAnnualIncomeTaxCalculation.taxYear)),
},
});
});Use calculateReportRequest when you have a full request and only need the
report. Use calculateReport when you already have descriptor-typed facts.
Owning sources
- SDK facade:
packages/sdk/typescript/src/index.ts - AU helpers:
packages/sdk/typescript/src/au.ts - Effect helpers:
packages/sdk/typescript/src/effect.ts