Quickstart
Run one Australian annual income tax calculation with the plain TypeScript SDK. This is the recommended first path for TypeScript applications.
Before you start
You need a TypeScript runtime that can import ESM packages. The SDK package is private until release approval, so run this from the TaxKit workspace for now.
Install
The intended public install shape is:
bun add @taxkit/sdk @taxkit/coreInside this repository, the workspace provides those packages already.
Run a calculation
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)),
});
console.log(report.liability.cents);aud(Cents.make(9_000_000)) represents AUD 90,000.00 as integer cents. The calculator
returns a typed annual income tax report.
Expected result
The report includes money values, ledger entries and calculator-specific fields. Access fields directly from the typed report:
console.log(report.liability.currency);
console.log(report.rawLiability.cents);Handle errors
Use the safe facade when you want a typed result instead of a rejected Promise:
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);
}Next steps
- Use Run your first calculation for a fuller copyable script.
- Compare surfaces in Choose SDK or HTTP API.
- Read Type safety before accepting user input.