@customyai/payload-plugin-customy-connect
v1.1.0
Published
Payload plugin for Customy integration with signing, retry, and observability hooks.
Downloads
272
Readme
@customyai/payload-plugin-customy-connect
Payload plugin to connect customer Payload projects with Customy integration APIs.
Features
- Signed webhook delivery (
x-customy-signature) - Canonical ingest support (
/api/integrations/ingest/lead) - Backward-compatible fallback to legacy webhook endpoint
- Retry with configurable attempts/backoff/timeout
- Optional delivery log writes to
webhook-deliveriescollection - Modular kernel lifecycle hooks (
beforeRender,afterRender,beforeSubmit,afterSubmit,onEvent) - Built-in modules (
forms,design,behavior) with extension support
Install
yarn add @customyai/payload-plugin-customy-connectUsage
import { buildConfig } from "payload";
import { customyConnect } from "@customyai/payload-plugin-customy-connect";
export default buildConfig({
// ...
plugins: [
customyConnect({
apiUrl: process.env.CUSTOMY_API_URL || "http://localhost:3005",
apiKey: process.env.CUSTOMY_CMS_API_KEY || "",
webhookSecret: process.env.CUSTOMY_WEBHOOK_SECRET || "",
design: {
tokens: {
primaryColor: "#4f46e5",
borderRadius: 12,
},
},
behavior: {
rules: [
{
id: "tag-new-lead",
event: "submission.created",
then: { type: "tag", value: "new-lead" },
},
],
},
retry: {
maxAttempts: Number(process.env.CUSTOMY_WEBHOOK_MAX_ATTEMPTS || 3),
baseDelayMs: Number(process.env.CUSTOMY_WEBHOOK_BASE_DELAY_MS || 350),
timeoutMs: Number(process.env.CUSTOMY_WEBHOOK_TIMEOUT_MS || 5000),
},
}),
],
});Required env vars
CUSTOMY_API_URL=http://localhost:3005
CUSTOMY_CMS_API_KEY=...
CUSTOMY_WEBHOOK_SECRET=...
CUSTOMY_WEBHOOK_MAX_ATTEMPTS=3
CUSTOMY_WEBHOOK_BASE_DELAY_MS=350
CUSTOMY_WEBHOOK_TIMEOUT_MS=5000Publishing
# from package directory
yarn install
yarn build
npm login
npm publish --access publicRelease notes
1.1.0
- Added modular kernel and lifecycle hook pipeline.
- Added built-in forms/design/behavior modules.
- Kept backward-compatible webhook fallback path.
