A Strapi plugin that extends the Preview Button to support multiple domains and locales. It automatically generates preview URLs using the correct frontend domain, making localized content preview easier across multiple websites and regional versions.
released September 3, 2026
npm install preview-button-multidomain
A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view multi domain and multi locals.
Depends on: strapi-plugin-preview-button@^3 (required peer; does not replace it).
Upstream: mattmilburn/strapi-plugin-preview-button
domains[].env keys on domains[].env (no auto-prefix)defaultEnv when locale/slug do not match{host} replacecontentTypes on this plugin, mirrored onto preview-button at bootstrap@^3 installed and enabled ('preview-button': true)Install and enable strapi-plugin-preview-button first. This extender only chooses the host; without upstream, there are no preview buttons. Peer install does not auto-enable it in Strapi — both plugins must appear in config/plugins.
npm install preview-button-multidomain strapi-plugin-preview-button@^3Docs: README · Release notes
config/pluginsMix patterns in one domains list: one host for several languages (DACH), plus another host for English.
| URL part | Who covers it |
|---|---|
| Host | This plugin — {host} from the matched domains row |
Path prefix (/de_DE/, /de_AT/, …) | Not this plugin — {localePath} (or another mapped entry field) in the template |
| Page slug | Upstream preview-button via {slug} |
// config/plugins.ts
export default ({ env }) => ({
'preview-button-multidomain': {
enabled: true,
config: {
domains: [
{
env: 'STRAPI_ADMIN_DOMAIN_DACH',
locales: ['de-DE', 'de-AT', 'de-CH'],
// host matching only — does NOT insert /de_AT/ into the URL
slugs: ['de_DE', 'de_AT', 'de_CH'],
},
{
env: 'STRAPI_ADMIN_DOMAIN_ENGLISH_1',
locales: ['en-GB'],
slugs: ['en'],
},
],
defaultEnv: 'STRAPI_ADMIN_DOMAIN_DACH',
contentTypes: [
{
uid: 'api::page.page',
draft: {
// {host} = this plugin; {localePath}/{slug} = upstream/entry fields
url: `{host}/{localePath}/{slug}?secret=${env('PREVIEW_SECRET')}&status=draft`,
},
published: {
url: `{host}/{localePath}/{slug}`,
},
},
],
},
},
// Required — npm dependency does not auto-enable Strapi plugins
'preview-button': true,
});STRAPI_ADMIN_DOMAIN_DACH=https://mydomain.com
STRAPI_ADMIN_DOMAIN_ENGLISH_1=https://english.example.com
PREVIEW_SECRET=your-preview-secretPrefer STRAPI_ADMIN_* for admin-related hosts. There is no auto-prefix: env is the exact process.env key.
This plugin does not auto-convert de-AT → /de_AT/.
Single locale, single slug (one language → one host):
{
env: 'STRAPI_ADMIN_DOMAIN_GERMAN',
locales: ['de-DE'],
slugs: ['de_DE'],
},Add more rows the same way — each env is a different host:
domains: [
{
env: 'STRAPI_ADMIN_DOMAIN_DACH',
locales: ['de-DE', 'de-AT', 'de-CH'],
slugs: ['de_DE', 'de_AT', 'de_CH'],
},
{
env: 'STRAPI_ADMIN_DOMAIN_ENGLISH_1',
locales: ['en-GB'],
slugs: ['en'],
},
{
env: 'STRAPI_ADMIN_DOMAIN_FRENCH',
locales: ['fr', 'fr-FR'],
slugs: ['fr'],
},
],
defaultEnv: 'STRAPI_ADMIN_DOMAIN_DEFAULT',STRAPI_ADMIN_DOMAIN_DACH=https://mydomain.com
STRAPI_ADMIN_DOMAIN_ENGLISH_1=https://english.example.com
STRAPI_ADMIN_DOMAIN_FRENCH=https://french.example.com
STRAPI_ADMIN_DOMAIN_DEFAULT=https://www.example.comdata.locale against domains[].localesdata.slug against domains[].slugs (slug can override; host matching only — does not write path prefixes)defaultEnv URL when setundefined into URLsIf extender contentTypes is empty, contentTypes already configured on preview-button still work. Prefer the single extender config above.
preview-button-before-buildpreview-button-multidomainconfig.domains (+ defaultEnv) instead of hard-coded DE/AT/CH envscontentTypes onto this plugin’s config (optional but recommended)'preview-button': truenpm run build
npm run verify
npm testOrganization: BrainStation-23
Author: Abu Sayed (sayedbs)
Repository: BrainStation-23/strapi-preview-multidomain-plugin
Release notes: https://github.com/BrainStation-23/strapi-preview-multidomain-plugin/blob/main/RELEASE.md
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
