

# Quickstart [#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 [#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 [#install]

The intended public install shape is:

```sh
bun add @taxkit/sdk @taxkit/core
```

Inside this repository, the workspace provides those packages already.

## Run a calculation [#run-a-calculation]

```ts
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 [#expected-result]

The report includes money values, ledger entries and calculator-specific
fields. Access fields directly from the typed report:

```ts
console.log(report.liability.currency);
console.log(report.rawLiability.cents);
```

## Handle errors [#handle-errors]

Use the safe facade when you want a typed result instead of a rejected Promise:

```ts
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 [#next-steps]

* Use [Run your first calculation](/start/run-your-first-calculation) for a
  fuller copyable script.
* Compare surfaces in [Choose SDK or HTTP API](/start/choose-sdk-or-api).
* Read [Type safety](/sdk/type-safety) before accepting user input.
