withCroct

Enable personalization for Storyblok content.

This function connects the Storyblok SDK to Croct to enable automatic content personalization.

It intercepts Storyblok API calls and replaces content that references slots with personalized content. In the Storyblok visual editor, personalization is automatically bypassed so editors always see the original content.

Signature

function withCroct(options: SbSDKOptions): SbSDKOptions

Example

12345678
import {storyblokInit, apiPlugin} from '@storyblok/js';import {withCroct} from '@croct/plug-storyblok/js';
storyblokInit(withCroct({  accessToken: 'YOUR_ACCESS_TOKEN',  use: [apiPlugin],  components: {},}));

Platform imports

The following table lists the import path for each supported platform:

PlatformImport path
JavaScript@croct/plug-storyblok/js
React@croct/plug-storyblok/react
Next.js@croct/plug-storyblok/next
Vue@croct/plug-storyblok/vue
Nuxt@croct/plug-storyblok/nuxt