| Name | Type | ID | Data Handling |
|---|---|---|---|
| Substack | Newsletter Blog | newsletter-substack | Client / Server |
Substack is a publication platform built around email-first newsletters and paid memberships. Publishers compose issues, schedule publishing, gate premium posts, and track subscriber analytics in one place.
Because Substack's core signup flow lives on the web UI, embedding it cleanly into custom sites often means resorting to iframes or redirect hacks. DocLayer’s adapter bridges that gap by running dedicated flow for you.
So, since Substack does not provide a standard API for basic newsletter subscriptions, DocLayer includes a dedicated adapter that automates the genuine Substack signup process using Playwright. When a user enters their email in the DlNewsletter component, the server uses Playwright to navigate through the Substack interface and complete the subscription - no need to embed Substack widgets or use complicated workarounds. Keep in mind that this approach utilizes a headless browser automation rather than an official API - that's the trick.
Start by installing the required Playwright browser binaries (once per project):
Next, register the adapter inside the app.config.ts file.
The adapter will now connect with the DlNewsletter component to subscribe new users from your website. Voilà! 🥳
Server handler included
It's very important to acknowledge that this integration uses a server-side, clever workaround to handle the subscription process. The adapter launches Playwright, navigates to Substack's subscription page, fills in the email field, and submits the form automatically. The server handler is automatically mounted at /api/adapter/substack, so you never need to expose any credentials - just provide the public Substack URL you wish to target. On the client side, the adapter sends the visitor’s email to this endpoint.
Substack requests are executed entirely server-side, so ensure your deployment environment supports running headless Chromium (Node). No API keys are required - just a publicly accessible Substack publication URL.
Keep Playwright installed
If your CI or deployment image does not cache Playwright browsers, add pnpm exec playwright install --with-deps (or the platform equivalent) to your build pipeline so the Substack handler can launch Chromium at runtime.
