---
url: 'https://adk.nht.io/api/@nhtio/adk/shims/functions/createAdkShim.md'
---

# Function: createAdkShim()

```ts
function createAdkShim<TBundle>(
  resolveFn: AdkResolverFn<TBundle>,
): AdkShim<TBundle>;
```

Defined in: [src/shims/index.ts:337](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/shims/index.ts#L337)

Construct a new [AdkShim](../interfaces/AdkShim.md) around a resolver.

## Type Parameters

| Type Parameter               | Default type                   | Description                                                        |
| ---------------------------- | ------------------------------ | ------------------------------------------------------------------ |
| `TBundle` *extends* `object` | [`@nhtio/adk`](../../index.md) | The shape of the bundle this shim wraps. Defaults to AdkNamespace. |

## Parameters

| Parameter   | Type                                                             | Description                                                                                                                                                                                                         |
| ----------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `resolveFn` | [`AdkResolverFn`](../type-aliases/AdkResolverFn.md)<`TBundle`> | The resolver this shim wraps. See [AdkResolverFn](../type-aliases/AdkResolverFn.md) and the module-level `@example` fences for the supported shapes (URL dynamic-import, same-graph passthrough, Worker handshake). |

## Returns

[`AdkShim`](../interfaces/AdkShim.md)<`TBundle`>

A new, independently-memoized [AdkShim](../interfaces/AdkShim.md).

## Remarks

Every call returns an independent shim with its own private memoization state — nothing is
shared between instances, and constructing one never invokes `resolveFn` eagerly (resolution
happens lazily, on first [AdkShim.resolve](../interfaces/AdkShim.md#resolve) call). Use this directly when you want a scoped,
non-ambient binding (e.g. one shim per loaded plugin version); use [registerAdkResolver](registerAdkResolver.md) /
[adk](../variables/adk.md) instead for the "one shared binding used across many files" ergonomics the docs app's
flagship agent needs.

## Example

Composing a battery into the resolved shape (the "battery-intersection" recipe):

```ts
type MyBundle = AdkNamespace &
  typeof import("@nhtio/adk/batteries/context/thrift");
const shim = createAdkShim<MyBundle>(() => loadMyPrecompiledBundle());
const { subtractToFit } = await shim.resolve();
```
