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
JavaScript
function withCroct(options: SbSDKOptions): SbSDKOptionsExample
JavaScript
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:
| Platform | Import 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 |