Run your first calculation
Use this page when you want a copyable script that runs a calculator through the plain SDK.
Before you start
The SDK package is private until release approval. Run this from the workspace or adapt the imports after the SDK is published.
Create a script
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({
liabilityCents: report.liability.cents,
currency: report.liability.currency,
});Understand the input
taxableIncome is a canonical calculator fact. The value uses the Money
schema from @taxkit/core/primitives, created with the aud constructor.
Pass integer cents rather than floating point dollars.
aud(Cents.make(9_000_000)); // AUD 90,000.00Use the generic facade
Australian helpers call the same generic facade that other SDK consumers use:
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)),
});Verify the result
The report type is inferred from au.calculations.annualIncomeTax. If you pass
facts for another calculator, TypeScript should reject the call before runtime.
Runtime schema decoding still protects calls that receive untrusted input.
Next steps
- Read Type safety for compile-time and runtime checks.
- Read Safe SDK if you want result values instead of rejected Promises.