DocsDeveloper SectionContent and Marketing

📝 Content and Marketing Features

The platform includes integrated tools for content and marketing teams to experience high flexibility without compromising security and performance.


👁️ Live CMS Preview (Next.js Draft Mode)

The store is fully integrated with the Preview system in Strapi and the Next.js Draft Mode mechanism. This feature allows the editorial team to view unpublished (Draft) content directly in the real frontend template.

Workflow:

  1. Start: The content manager clicks on the Preview button in the Strapi panel.
  2. Validation: Strapi redirects the user to the api/preview/route.ts path along with a signed URL containing REVALIDATE_SECRET.
  3. Activate Draft Mode: The server validates the HMAC hash using node:crypto and, if correct, turns on Draft Mode (sends secure session cookie).
  4. Live Render: The user is redirected to the target page and sees the Draft version of the content.
Unified Secret with REVALIDATE_SECRET
For simplified setup and unified security, both Strapi live preview and ISR Webhooks share the single REVALIDATE_SECRET environment variable in your root .env file, removing the need for a separate preview key.

📨 Newsletter and Anti-Spam (Rate Limiting)

The newsletter subscription system (api/newsletter/route.ts path) is directly connected to the powerful SendPulse CRM.

Security via Rate Limiting

To prevent Bot Abuse and flooding of the newsletter database or exhausting third-party API request quotas, this endpoint uses a native IP-based Rate Limiter.

  • Maximum allowed requests: 2 requests
  • Time window: 1 hour (60 * 60 * 1000 milliseconds)
  • Tracking mechanism: The user's IP address is extracted via the x-forwarded-for header and tracked in the server's memory cache.
  • If the limit is exceeded, the server returns a 429 Too Many Requests error.
.env (SendPulse Variables)
bash
SENDPULSE_API_ID=your_api_id
SENDPULSE_API_SECRET=your_api_secret
SENDPULSE_BOOK_ID=your_target_mailing_list_id