---
url: 'https://adk.nht.io/api/@nhtio/adk/batteries/functions/createIsolatedService.md'
---

# Function: createIsolatedService()

```ts
function createIsolatedService<S>(
  spec: S,
  transport: IsolationTransport,
  options?: IsolatedServiceOptions,
): IsolatedService<S>;
```

Defined in: [src/batteries/isolation/host.ts:91](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/host.ts#L91)

Build an [IsolatedService](../interfaces/IsolatedService.md) over `transport` for `spec`. Connection + the first `ready` handshake
begin immediately (fire-and-forget internally); calls made before `ready` queue inside the underlying
[HostEndpoint](../classes/HostEndpoint.md) and flush in order once it arrives.

## Type Parameters

| Type Parameter                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `S` *extends* [`IsolatedServiceSpec`](../interfaces/IsolatedServiceSpec.md)<[`MethodMap`](../type-aliases/MethodMap.md), [`StreamMap`](../type-aliases/StreamMap.md), [`EventMap`](../type-aliases/EventMap.md)> |

## Parameters

| Parameter   | Type                                                                |
| ----------- | ------------------------------------------------------------------- |
| `spec`      | `S`                                                                 |
| `transport` | [`IsolationTransport`](../interfaces/IsolationTransport.md)         |
| `options?`  | [`IsolatedServiceOptions`](../interfaces/IsolatedServiceOptions.md) |

## Returns

[`IsolatedService`](../interfaces/IsolatedService.md)<`S`>

## Throws

@nhtio/adk/batteries/isolation!E\_INVALID\_ISOLATION\_OPTIONS when `options` fails
validation.
