Skip to content
Zid partners
Developer programsAn overview of every way to build on ZidApp PartnersPublish your app in the Zid App MarketTheme PartnersLaunch your theme in the Zid Theme Market
App MarketApps available to Zid merchantsTheme MarketThemes ready to install
Support
Partner help centreHow-to guides and troubleshootingDeveloper docsAPIs, SDKs and integration guidesBook a meetingA business or technical support call
What's new
BlogGuides and updates for developersChangelogThe latest partner platform updatesSuggest a featureThe feedback and ideas board
Partner enablement
Partner AdsVisibility packages on Zid’s channelsCustom themesThemes built for one merchantPartner communityConnect with developers building on Zid
Zid library
Zid reportsEverything you need to know about the marketDeveloper guidesOfficial references to build on
العربيةLog inJoin as a partner
Partner programs
Developer programsApp PartnersTheme Partners
Browse the market
App MarketTheme Market
Support & enablement
Partner help centreDeveloper docsBook a meetingBlogChangelogSuggest a featurePartner AdsCustom themesPartner communityZid reportsDeveloper guides
Language
العربية
Log inJoin as a partner
Home/Blog/APIs & integration
APIs & integration

Embedded apps on Zid: build inside the merchant dashboard

How embedded apps load inside the Zid merchant dashboard, the six-step auth flow, and the tools that help: Zid MUI, the Zid SDKs and storefront events.

Sep 24, 20266 min read

Why build an embedded app

An embedded app runs inside the Zid Merchant Dashboard through an iframe. Merchants open and use your app without leaving the dashboard and without a separate login.

The docs list what partners get from this:

  • Seamless integration: one unified experience for the merchant.
  • More visibility: more exposure and engagement for your app.
  • Simpler access: no separate logins.
  • Loyalty: a smoother experience leads to higher satisfaction and longer use.

The authentication flow in six steps

Embedded apps skip the standard login. The flow has six mandatory steps:

  1. Merchant installs the app. Zid redirects to your Redirect URL with an authorization code. Your initial OAuth request must include the embedded_apps_tokens_write scope.
  2. Exchange the code for tokens. Save access_token, authorization and refresh_token against the merchant's store_id.
  3. Register a lookup token. Generate a UUID (version 4) on your server, store it with the merchant's tokens, and register it with Zid. Don't use the authorization JWT here: it's too long and gets truncated in the iframe URL.
  4. Set the Application URL. In your developer dashboard, point it to a fixed endpoint that serves the iframe, for example https://your-app.com/embedded.
  5. Merchant opens the app. Zid loads your Application URL in an iframe and appends your UUID.
  6. Identify and render. Read the token parameter, look up the UUID to get the store_id and tokens, then render the page.

Registering the UUID in step 3:

curl -X POST 'https://api.zid.sa/v1/managers/embedded-apps-token' \
  --header 'Authorization: Bearer {{authorization}}' \
  --header 'x-manager-token: {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{
      "token": "{{your_generated_uuid}}"
  }'

And what your Application URL receives in step 5:

GET /embedded?token={{your_generated_uuid}}&language=en

Redirects, security and token cleanup

When your app finishes the OAuth flow, you can send the merchant straight to the app inside the dashboard:

https://dashboard.zid.sa/{language_code}/stores/{store_id}/apps/{app_id}/embedded

{app_id} must be your real Zid app ID. Zid resolves the correct store and dashboard language from the merchant's session, so you don't need to detect the language yourself.

Zid enforces a Content Security Policy on embedded apps. Every page served in the iframe must send the CSP headers listed in the docs. Without the frame-ancestors directive, the dashboard blocks your iframe.

Common pitfalls from the docs:

  • Give each store its own unique UUID, and generate a new one when a merchant reinstalls. The old one becomes stale.
  • Use URL-safe tokens. UUIDs (hex plus hyphens) are safe.
  • Keep access_token and authorization on your server. Never expose them to the browser or the iframe HTML.
  • When a merchant uninstalls, delete their token with DELETE https://api.zid.sa/v1/managers/embedded-apps-token.
There's a community starter project (Flask) linked from the Embedded Apps page that implements all six steps. It isn't an official Zid package, but it's a useful reference.

Look native with Zid MUI

If you're building an embedded app, the docs recommend Zid MUI to keep your UI consistent with the Zid dashboard. It's a UI library built on the MUI design system and Zid's brand guidelines, with shared components, icons, hooks and theme utilities, and RTL support out of the box.

There are two ways to use it:

  • React: the full component library. Wrap your app in MUI's ThemeProvider with themeParcel, then import components such as AppButton and AppInputBase.
  • CSS only: for Vue, Angular or vanilla JS. Run pnpm add @zidsa/zidmui, import the stylesheet, add the IBM Plex Sans Arabic font, and use classes such as zid-button and zid-input.

React install:

pnpm add @zidsa/zidmui react react-dom use-debounce @mui/material @mui/lab @emotion/styled

You can browse every component in the Zid MUI Storybook at ui.zid.sa.

Faster backends with the Zid SDKs

The Zid SDKs handle communication with Zid APIs for you, and they include predefined data models for API responses. That makes them a good fit for backend services, automation scripts and integrations.

  • Python: available now, on GitHub at zidsa/sdk-python, with a demo app at zidsa/demo-app-python.
  • Laravel and TypeScript: listed in the docs as coming soon.

React to what happens on the storefront

Many embedded apps also need to know what shoppers do in the store. With Custom Snippets, your app can inject JavaScript or CSS into every store where it's installed. Add them from your app's General Settings in the Partner Dashboard and submit them for review.

Your scripts can read global objects such as window.customer, window.customerAuthState and window.customerAsync, and respond to seven supported storefront events:

  • Purchase, Product View, Add to Cart, Remove from Cart, and Start Checkout.
  • View Item List and Select Item, both marked as new in the docs.
Test your snippets in a development store before you publish, and keep them light so they don't slow down the storefront.

Key takeaways

  • Embedded apps load in an iframe inside the merchant dashboard, with no separate login.
  • Request the embedded_apps_tokens_write scope, and register a UUID, never the JWT, as the lookup token.
  • Send the required CSP headers, including frame-ancestors, on every page in the iframe.
  • Use Zid MUI for the UI, the Python SDK for your backend, and storefront events for shopper activity.

Sources

  1. Embedded Apps - Zid Docs
  2. Zid MUI - Zid Docs
  3. Zid SDKs - Zid Docs
  4. StoreFront Events - Zid Docs

Start building on Zid

Sign up in the partner portal, then build and test on a development store.

Create your account →

Contents

  1. Why build an embedded app
  2. The authentication flow in six steps
  3. Redirects, security and token cleanup
  4. Look native with Zid MUI
  5. Faster backends with the Zid SDKs
  6. React to what happens on the storefront

Share

Start building

Related articles

→
APIs & integration

Webhooks on Zid: subscribe, monitor health and recover broken endpoints

Subscribe to store events, keep your endpoints healthy, and bring a broken webhook back to life with Zid's health tracking and recovery APIs.

4 min read
APIs & integration

Connecting to Zid with OAuth 2.0: tokens, headers and the activation policy

How Zid's authorization code flow works, which token goes in which header, when tokens expire, and what the activation policy expects from your app.

4 min read
Developer updates

The Account API: moving off GET v1/managers/profile

Zid is retiring GET v1/managers/profile, with migration due 30 September 2026. Here are the new Account API endpoints, their scopes and a migration checklist.

5 min read
Zid Partners

Partner programs

Developer programsApp PartnersTheme PartnersCreate your account

Resources

BlogPartner AdsZid reportsDeveloper docsPartner help centerChangelogRequest a feature

Browse the market

App MarketTheme Market

Terms & policies

App Partner termsTheme Partner termsTheme commercial policyPrivacy policy

Get in touch

Book a business callBook a technical support callTheme designers community
Zid — Al-Qudrah Al-Taqniyah for Technology and Communicationالعربية
Al-Qudrah Al-Taqniyah for Technology and Communication CompanyCR No. 1010365366VAT No. 300827827900003