> ## 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@beta
  ```

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

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

Current version: **1.3.0**. See the [changelog](/sdk/changelog).

<Note>
  Releases are published to the npm `beta` dist-tag. Install with `@beta` to get the current release. Without it, npm resolves the `latest` tag, which can point to an older version.
</Note>

## 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 is compiled for ES2022 and uses features such as optional chaining, nullish coalescing, and `BigInt`. Strict mode is recommended:

```json tsconfig.json theme={null}
{
  "compilerOptions": {
    "target": "ES2022",
    "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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.