croct-tech/agent-skills / skills/croct-integrate-platforms
croct-integrate-platforms
VerifiedUse when connecting Croct to a third-party platform or migrating to Croct from another personalization or experimentation tool. Covers Storyblok (Optimize by Croct app, @croct/plug-storyblok, Storyblok withCroct, resolveContent, croct/plug-storyblok, CroctStoriesApi), Sanity and Strapi (slot fallback, dynamic zones, metadata.contentSource), Shopify Hydrogen storefront events, Shopify custom pixel (croctPixel, PUBLIC_CROCT_SHOPIFY_PIXEL, checkout and order tracking), VTEX, Google Tag Manager data layer, Microsoft Clarity tags, HubSpot forms (hbspt.forms.create, hs-form-event), firmographic providers 6sense, Demandbase, Clearbit Reveal, and ZoomInfo WebSights (firmographics attributes, account-based audiences in CQL), and migrations from Mutiny and Ninetailed (Experience component, Contentful sunset). Triggers include cdn.croct.io/plug-integration scripts, "personalize Storyblok blocks", "track Shopify checkout", "send VTEX events", "ABM personalization", "replace Mutiny".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.9 KB |
| references/analytics-and-crm.md | markdown | 7.5 KB |
| references/ecommerce.md | markdown | 10.0 KB |
| references/firmographics.md | markdown | 14.0 KB |
| references/headless-cms.md | markdown | 5.6 KB |
| references/migrations.md | markdown | 10.0 KB |
| references/storyblok.md | markdown | 10.9 KB |
references/headless-cms.md
View on GitHub# Sanity and Strapi
Neither integration has a Croct package of its own. The CMS keeps managing static content; your app
fetches a Croct slot and passes the CMS content as the `fallback`. Croct reads nothing from the CMS
and writes nothing back, so you can adopt it one component at a time and roll back by removing a
single `fetchContent` call. Pages behave exactly as today until the first experience launches.
Examples below use the Next.js SDK (`@croct/plug-next/server`), as the docs do. For other stacks,
use the equivalent fetch function of that SDK (see the `croct-integrate-sdk` skill).
## Shared setup
1. Prerequisites: a Croct workspace and application, and a CMS project with content.
2. Run the CLI in the frontend project. It detects the setup, installs the SDK, and wires the
provider and middleware:
```sh
croct init
```
3. For each module or component to make dynamic, create a Croct **component** and a **slot**.
4. **The Croct component must mirror the CMS schema, using the same attribute names**, so dynamic
content and CMS content are interchangeable in the same rendering component.
5. Fetch the slot with the CMS content as `fallback` (below).
6. Decide where default content lives (below).
7. Verify: load the page (default shows), publish an experience or AB test on the slot, reload as a
matching visitor (dynamic content shows).
## Sanity
```jsx
// components/HomeHero.jsx
import {fetchContent} from '@croct/plug-next/server';
export async function HomeHero() {
const sanityHero = await getSanityHero();
const {content} = await fetchContent('home-hero@1', {
fallback: sanityHero,
});
return <Hero {...content} />;
}
```
Demo: `https://github.com/croct-tech/croct-sanity-project` (see `frontend/app/page.tsx`).
## Strapi
The integration builds on Strapi **dynamic zones**: each dynamic zone component is a natural unit of
dynamic content. One Croct slot holds a map from Strapi pages and dynamic zone components to Croct
slots. When rendering, each mapped component gets its content from its Croct slot, with the original
Strapi content as fallback.
### Mapping component
Create a Croct component with these attributes:
| Attribute | Description | Type | Required |
|--------------------------------|----------------------------------------------|-------------------|----------|
| `map` | Pages and their dynamic-zone-to-slot maps. | List of structure | Yes |
| `map[*].slug` | Page slug as defined in Strapi. | Plain text | Yes |
| `map[*].sections` | Sections to connect. | List of structure | Yes |
| `map[*].sections[*].component` | Component ID as defined in Strapi. | Plain text | Yes |
| `map[*].sections[*].slot` | Slot ID as defined in Croct. | Plain text | Yes |
For `component` and `slot`, select **Not empty** and use the pattern `^[a-z0-9_-]+$`. Then create the
slot `home-page-dynamic-zones` holding the map of pages and sections to connect.
Implement the lookup following the demo:
`https://github.com/croct-tech/croct-strapi-project/blob/main/next/app/%5Blocale%5D/(marketing)/page.tsx`.
For each mapped zone, fetch the mapped slot and merge the result over the Strapi component:
```jsx
import {fetchContent} from '@croct/plug-next/server';
const {content} = await fetchContent(mapping.slot, {
preferredLocale: params.locale,
fallback: zone,
});
return {...zone, ...content};
```
The docs do not publish the full lookup code inline; read the demo file for how `mapping` is found
from the page slug and the zone's component ID.
## Where default content lives
Both the CMS and Croct can serve the default content (what visitors see when no experience or AB
test targets them). Ask the user which side should own it; it is a structural decision.
| Approach | Croct serves | CMS serves | Editors manage defaults in |
|----------------------------------|----------------------|-------------------------|----------------------------|
| Default in Croct (recommended) | Default and dynamic | Fallback only | Croct |
| Default in CMS | Dynamic only | Default and fallback | The CMS |
Croct recommends the first: experiences and AB tests are faster to configure because editors copy
the slot content as a base and change only what differs. Teams choose the second to keep the
editorial workflow mostly unchanged. The plain `fetchContent` examples above implement the first.
To implement default-in-CMS, check `metadata.contentSource`. When it is `slot`, no experience or AB
test matched, so render the CMS content:
```jsx
// Sanity
import {fetchContent} from '@croct/plug-next/server';
export async function HomeHero() {
const sanityHero = await getSanityHero();
const {content, metadata} = await fetchContent('home-hero@1', {
fallback: sanityHero,
});
// Render the Sanity content unless Croct returned dynamic content
const hero = metadata?.contentSource === 'slot' ? sanityHero : content;
return <Hero {...hero} />;
}
```
```jsx
// Strapi
import {fetchContent} from '@croct/plug-next/server';
const {content, metadata} = await fetchContent(mapping.slot, {
preferredLocale: params.locale,
fallback: zone,
});
// Use the Strapi content unless Croct returned dynamic content
return metadata?.contentSource === 'slot' ? zone : {...zone, ...content};
```
## Sources
- https://docs.croct.com/immersion/integrations/cms/sanity.md
- https://docs.croct.com/immersion/integrations/cms/strapi.md
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |