Greta Strapi Connector logo

Greta Strapi Connector

By Greta

Connect Strapi 5 with Greta to sync mapped published content and import Greta-generated content as unpublished drafts.

Latest version

v0.1.0

released September 29, 2026

npm install @questlabs/greta-strapi-plugin

Greta Strapi Connector

@questlabs/greta-strapi-plugin connects a Strapi 5 server to Greta's CMS connector API. It syncs only content types and fields that you explicitly map, and can create Greta-generated content as an unpublished Strapi draft. It never publishes or updates an existing entry.

Requirements

  • Strapi 5.x with Node.js 20 or newer.
  • A Greta project connection created for platform strapi.
  • Enable that connection in Greta before the plugin can sync. Keep the one-time connector key on the Strapi server; do not put it in browser code.

Install

npm install @questlabs/greta-strapi-plugin

Add the plugin configuration to config/plugins.ts (or config/plugins.js):

export default ({ env }) => ({
  greta: {
    enabled: env.bool("GRETA_CMS_ENABLED", false),
    config: {
      enabled: env.bool("GRETA_CMS_ENABLED", false),
      apiUrl: env("GRETA_CMS_API_URL", "https://app.greta.sh/api/greta/cms"),
      apiKey: env("GRETA_CMS_API_KEY", ""),
      syncIntervalMs: env.int("GRETA_CMS_SYNC_INTERVAL_MS", 3600000),
      // Explicit allowlist: don't sync fields you have not reviewed.
      contentTypes: env.json("GRETA_STRAPI_CONTENT_TYPES", [
        {
          uid: "api::article.article",
          contentType: "article",
          titleField: "title",
          slugField: "slug",
          bodyField: "body",
          excerptField: "excerpt",
          pathPrefix: "/blog",
        },
      ]),
      siteUrl: env("GRETA_CMS_SITE_URL", ""),
      drafts: {
        enabled: env.bool("GRETA_STRAPI_IMPORT_DRAFTS", false),
        contentTypeUid: "api::article.article",
        titleField: "title",
        bodyField: "body",
        slugField: "slug",
        pathPrefix: "/blog",
      },
    },
  },
});

Set the key and settings in the Strapi server's secret environment, not in the admin frontend:

GRETA_CMS_ENABLED=true
GRETA_CMS_API_KEY=grc_sk_... # generated once by Greta for this Strapi site
GRETA_CMS_API_URL=https://app.greta.sh/api/greta/cms
GRETA_CMS_SITE_URL=https://www.example.com
GRETA_CMS_SYNC_INTERVAL_MS=3600000
GRETA_STRAPI_IMPORT_DRAFTS=false

Restart Strapi after changing plugin config. The connector checks its Greta connection on startup and on the configured interval. It sends only the mapped content fields and only entries queried with Strapi's status: "published".

Drafts

Draft import is opt-in. Enable GRETA_STRAPI_IMPORT_DRAFTS, grant this key the draft:pull and draft:ack scopes, and configure a destination collection with Draft & Publish enabled. Greta items are created with status: "draft"; a stable generated slug makes retries idempotent. The plugin acknowledges the draft to Greta only after Strapi confirms it exists. Failed drafts remain visible for a manual retry in Greta.

Safety

  • The connector is disabled by default.
  • It requires HTTPS except for localhost development.
  • It stores no Greta key in Strapi content or browser code.
  • It ignores all content types not explicitly mapped.
  • It never calls Strapi's publish operation.
  • Draft import never overwrites an existing Strapi document.

The connection, content-sync, and draft-delivery endpoints are provided by Greta's CMS connector service.

Submit your content

Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.

Submit
Submit your content