@contfu/strapi
v0.1.0
Published
Strapi v4/v5 plugin for sending signed Contfu webhooks.
Readme
@contfu/strapi
Strapi v4/v5 plugin for sending signed Contfu webhooks.
Install
npm install @contfu/strapiConfigure
// config/plugins.ts
export default ({ env }) => ({
contfu: {
enabled: true,
config: {
webhookUrl: env("CONTFU_WEBHOOK_URL"),
webhookSecret: env("CONTFU_WEBHOOK_SECRET"),
},
},
});The plugin registers static Strapi entry lifecycle webhook handlers for Strapi v4 and v5 and sends x-strapi-signature: sha256=<hmac> over the exact JSON request body using the configured webhook secret.
Strapi v4 notes
Contfu supports Strapi v4 and v5 as source connections.
- The API token must read collection entries and Content-Type Builder schemas. On some v4 projects the schema endpoints live under
/content-type-builder/*and require admin/elevated access rather than a regular Content API token. - Draft sync uses Strapi v4
publicationState=preview/liveand Strapi v5status=draft/published. Contfu exposes$draftwhen draft sync is enabled. - Native Strapi v4 webhooks are accepted, including payloads that only contain numeric
idvalues. Contfu usesString(id)as the item ref whendocumentIdis absent. - Signed webhook verification requires
x-strapi-signatureorx-webhook-signatureinsha256=<hex>HMAC format. The Contfu plugin sends this format; built-in Strapi v4 webhook secret behavior can differ by version/plugin. - Strapi v4
populate=*is shallow, so deeply nested relations/components may need custom Strapi API configuration before Contfu can see them.
