Skip to content

App Embed Settings Plan

Plan for exposing widget settings inside Shopify Theme Editor app embed.

Status: IMPLEMENTED (simplified model: embed activation only + DB-first appearance settings).

Allow merchants to configure key chat widget options directly from Shopify Theme Editor app embed settings, while keeping your in-app Admin pages as the source of advanced configuration.

Target editor location:

  • Online Store -> Themes -> Customize -> App embeds -> Appifire AI Chat

  • Merchants expect storefront display controls in Theme Editor.
  • Faster activation and simpler onboarding (toggle + visual options in one place).
  • Reduces context switching between app admin and theme customizer.
  • Keeps app aligned with common Shopify app UX conventions.

Theme Editor app embed now exposes no storefront controls.

  • Merchant action in Theme Editor: enable the AppiFire Chat embed and save.
  • No title/message/color/position fields are configured in Theme Editor.

All other widget settings are managed in app admin only:

  • Widget title
  • Welcome message
  • Brand color
  • Bubble position
  • Business/operational settings (billing, limits, data sync, knowledge, etc.)

To avoid conflicts between Admin app settings and Theme Editor app embed settings, the implementation uses a DB-first runtime model.

  1. Database value (shops table) is canonical.
  2. Admin edits write directly to DB.
  3. Storefront widget runtime fetches DB settings from GET /api/widget-settings.
  4. Code defaults are used only when DB/client values are missing or invalid.
  • Keep current DB fields (no destructive change).
  • Read embed settings in storefront runtime (window.AppifireChat.settings) as optional metadata only.
  • Fetch DB settings from GET /api/widget-settings and apply them for appearance values (title, welcome message, brand color, bubble position).
  • Result: merchants manage all widget behavior in app admin, and use Theme Editor only to activate embed placement.

  • Merchant enables embed and clicks Save in theme customizer.
  • Storefront preview updates immediately.
  • Keep existing forms.
  • Add helper copy:
    • “App admin is the source of truth. Theme Editor embed fields can remain empty.”
  • Keep deep link action: “Open Theme Editor (App embeds)”.

Add quick links so merchants know where to configure related features outside embed display settings:

  • Appearance (/app/appearance) — visual widget settings and storefront visibility.
  • Knowledge Hub (/app/knowledge) — website/business content used for responses.
  • Chats (/app/chat-logs) — review real conversations and optimize copy.
  • Billing (/app/billing) — plan, usage, and credit balance management.

Suggested placement:

  • In the app embed help/description text, include module navigation shortcuts back to app admin:
    • Dashboard (/apps/appifire-ai-chat/app)
    • Chats (/apps/appifire-ai-chat/app/chat-logs)
    • Data Sync (/apps/appifire-ai-chat/app/data-sync)
    • Knowledge Hub (/apps/appifire-ai-chat/app/knowledge)
    • Settings (/apps/appifire-ai-chat/app/settings)
    • Appearance (/apps/appifire-ai-chat/app/appearance)
    • Billing & Usage (/apps/appifire-ai-chat/app/billing)
  • In the Appearance page, show clear links:
    • Dashboard (/app)
    • Chats (/app/chat-logs)
    • Data Sync (/app/data-sync)
    • Knowledge Hub (/app/knowledge)
    • Settings (/app/settings)
    • Appearance (/app/appearance)
    • Billing & Usage (/app/billing)
  • Optional: in Theme Editor docs/help tooltip with “Open App Admin” deep links.

  • Keep app embed extension schema informational-only:
    • no runtime behavior controls in embed settings
    • include guidance text + admin module links

Step 2: Wire settings into storefront widget runtime

Section titled “Step 2: Wire settings into storefront widget runtime”
  • In widget liquid/script render path:
    • Read widget_enabled from Shopify-provided embed settings.
    • Pass these values into chat-widget.js config.
    • Resolve effective values with DB-first precedence for appearance settings.
    • Keep defaults as final fallback for invalid/missing values.
  • If merchant has not saved embed settings, existing DB-driven behavior remains unchanged.
  • No migration required for initial rollout.
  • Add subtle notice in Appearance page clarifying DB-first behavior.
  • Add “Open Theme Editor” action for convenience.
  • Add quick nav links to related pages: Appearance, Knowledge Hub, Chats, Billing.
  • New install: defaults render correctly.
  • Existing install with DB values: behavior unchanged.
  • Title + welcome + color + position + visibility update correctly from app admin.
  • Admin change appears on storefront immediately after save.
  • Theme Editor shows informational text with admin navigation links.
  • Mobile + desktop behavior remains stable.

  • Theme Editor used for embed activation only
  • Keep all appearance fields in app admin
  • If needed, expose selected advanced controls in Theme Editor after merchant feedback

  1. Confusion from duplicated settings
    • Mitigation: clear precedence note in admin UI.
  2. Theme-specific differences
    • Mitigation: test on Dawn + one custom theme.
  3. Unexpected mobile regressions
    • Mitigation: dedicated device QA checklist before release.

Keep Theme Editor embed simple with activation-only flow.
Keep visual, business, and operational controls inside app admin.
Keep shops table as source of truth for appearance values and provide clear in-app navigation guidance.