> ## Documentation Index
> Fetch the complete documentation index at: https://docs.outcome.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the @outcome.xyz/hip4 SDK: setup and entry points

> Install @outcome.xyz/hip4 in a TypeScript project with pnpm, npm, or yarn, and learn the two entry points, ESM and CommonJS formats, and TypeScript compiler options.

The SDK is published to npm as `@outcome.xyz/hip4`. It ships with full TypeScript types, supports both ESM and CommonJS, and has no runtime dependencies beyond your own project's dependencies.

## Install

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add @outcome.xyz/hip4
  ```

  ```bash npm theme={null}
  npm install @outcome.xyz/hip4
  ```

  ```bash yarn theme={null}
  yarn add @outcome.xyz/hip4
  ```
</CodeGroup>

Current version: **1.0.3-beta** - see the [changelog](/sdk/changelog)

## Entry points

The package exposes two entry points:

| Entry point               | Use when                                                             |
| ------------------------- | -------------------------------------------------------------------- |
| `@outcome.xyz/hip4`       | Importing the adapter, utility functions, and types in the same file |
| `@outcome.xyz/hip4/types` | Importing types only, without pulling in any runtime code            |

```typescript theme={null}
// Main entry - adapter, utilities, and types
import { createHIP4Adapter, formatPrice, getMinShares } from "@outcome.xyz/hip4";
import type { DefaultBinaryMarket, PredictionOrderResult } from "@outcome.xyz/hip4";

// Types-only entry - useful in shared type packages or when tree-shaking matters
import type { HIP4Market, MarketType } from "@outcome.xyz/hip4/types";
```

## TypeScript requirements

The SDK targets ES2020 and uses features such as optional chaining, nullish coalescing, and `BigInt`. Strict mode is recommended:

```json tsconfig.json theme={null}
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true
  }
}
```

<Note>
  The SDK has zero runtime dependencies. Installing it will not add any third-party packages to your `node_modules`.
</Note>

## Module format support

The package ships both ESM (`.js`) and CommonJS (`.cjs`) builds. Your bundler or runtime will pick the right format automatically based on your project's `"type"` field and import syntax. No additional configuration is required.
