Dynamic Domains Configuration

Learn how to use dynamic domains with the Partner Fleet embedded iframe so CTA destination URLs resolve correctly across environments.

Using Dynamic Domains with Embedded Iframe

If you're embedding your Partner Fleet-powered marketplace across multiple environments (e.g., staging, production), you can dynamically insert the current domain into your custom CTA destination URLs using the urlVariables parameter. This avoids hardcoding URLs and ensures links always point to the correct environment.

Step 1: Pass the domain to the iframe

When initializing the EmbeddedIframe, add a urlVariables key with the domain. You can include any variables here that you need for proper URL generation — you can use variables beyond domain:

new EmbeddedIframe({
  iframeOrigin: 'https://your-partner-fleet-domain',
  trustedOrigins: ['https://your-partner-fleet-domain'],
  containerId: 'iframe-container',
  urlVariables: {
    domain: window.location.origin
  }
});

This makes the current domain (e.g., https://yourapp.com) available to any destination URL using {{domain}}.

Step 2: Use {{domain}} in your destination URLs

When setting up a Go to URL destination on the Buttons & Actions tab, the Permissions No Access Fallback, or any Per-Listing Override, format the destination URL like this:

{{domain}}/path/to/your/page

Example

If your end user is on https://app.mycompany.com and you configure your destination as:

{{domain}}/integration-setup

It will resolve to:

https://app.mycompany.com/integration-setup

This ensures your links always point to the correct environment without hardcoding any URLs.

Use Dynamic Domain checkbox

On the Buttons & Actions tab, when you select Go to URL as a destination, a Use Dynamic domain checkbox appears. Check this when you want the URL to use the runtime {{domain}} variable rather than a hardcoded URL. The checkbox provides a clearer admin UX than typing the {{domain}} prefix manually.

🚧

Important

Add every environment URL (production, staging, development) to your Allowed Domains list in Settings > In-App Marketplace > Developer Settings. Without this, the marketplace will not render in that environment regardless of how the dynamic domain resolves.

What's Next


Did this page help you?