# Function: getIpaHub()

```ts
function getIpaHub(options?): Promise<IpaHub>;
```

Defined in: [src/getIpaHub.ts:40](https://github.com/giladgd/ipa-hub/blob/master/src/getIpaHub.ts#L40)

Initialize an ipa-hub instance for library use.

Uses the current user's Xcode signing setup; no Apple password is requested.
Each call creates an independent instance with its own callbacks and data-directory
configuration. Installed apps and downloads persist between instances.
Installations delegate to a compatible running server unless bypassServer is set.
Call dispose after outstanding operations finish. Your application handles publisher
trust confirmation and can provide select for ambiguous devices, assets, or teams.
On non-macOS systems, warns and returns an inactive instance without creating storage.
Device, team, app, and release lists are empty; other operations reject with a macOS-only
error. The development environment variable IPA_HUB_DEV_ALLOW_NON_MACOS=1 bypasses this
restriction, but does not emulate Apple's tools or devices.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `options?` | [`IpaHubOptions`](https://ipa-hub.giladgd.com/docs/api/type-aliases/IpaHubOptions.md) | Data directory, callbacks, cancellation, and an optional update-server address. |

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`IpaHub`](https://ipa-hub.giladgd.com/docs/api/classes/IpaHub.md)\>

An initialized IpaHub instance, or an inactive instance on unsupported platforms; rejects on storage errors.

## Example

```ts
import os from "node:os";
import path from "node:path";
import {getIpaHub} from "ipa-hub";

const hub = await getIpaHub({
    dataDir: path.join(os.homedir(), ".ipa-hub"),
    onProgress({message}) {
        console.log(message);
    }
});
try {
    const devices = await hub.listDevices({types: ["iphone"]});
    const result = await hub.install({source: "gh:utmapp/UTM", filter: "^UTM$", device: devices[0]?.id});
    console.log(`Installed ${result.app.name} on ${result.device.name}`);
} finally {
    await hub.dispose();
}
```

