# resolveContent

Learn how to resolve Croct content in a Storyblok story.

This function walks a Storyblok content tree and replaces every block linked to a Croct [slot](/explanation/slot) with the personalized content fetched from Croct, converted to the Storyblok shape.

It is the low-level building block that [`withCroct`](with-croct) uses internally, exposed for custom integrations that the platform wrappers do not cover. When a fetch returns no content or fails, the block keeps its original content.

## Signature \[#signature]

This function has the following signature:

```ts
function resolveContent(content: unknown, fetcher: ContentFetcher): Promise<unknown>
```

This function returns a copy of the content with every linked block resolved.

## Example

Here is a basic example of how to use this function with the JavaScript SDK:

```ts
import {resolveContent} from '@croct/plug-storyblok';
import croct from '@croct/plug';

const personalizedStory = await resolveContent(
    story,
    slotId => croct.fetch(slotId, {includeSchema: true}),
);
```

The fetcher must request the content schema so the conversion to the Storyblok shape can be schema-driven.

## Parameters

The following list describes the supported parameters:

- `content`: `unknown`

  The Storyblok content to resolve, such as a story or any nested structure.

- `fetcher`: [`ContentFetcher`](/reference/sdk/storyblok/api/javascript/types/content-fetcher)

  The callback that fetches a slot's content by ID.
