shopify_app_bridge_flutter library

Flutter Web package for integrating with the Shopify App Bridge JS SDK.

Allows Flutter apps to run as embedded Shopify Admin apps with access to:

  • Toast notifications
  • Admin navigation / redirects
  • Session tokens for backend auth

Setup

  1. Copy web/shopify_bridge_interop.js (from this package) into your app's web/ directory.
  2. In web/index.html, include both scripts before main.dart.js:
    <script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>
    <script src="shopify_bridge_interop.js"></script>
    
  3. Initialize in main.dart:
    import 'package:shopify_app_bridge_flutter/shopify_app_bridge_flutter.dart';
    
    void main() async {
      WidgetsFlutterBinding.ensureInitialized();
      await ShopifyAppBridge.init(
        apiKey: 'YOUR_API_KEY',
        host: ShopifyHostHelper.hostFromUrl(),
      );
      runApp(const MyApp());
    }
    

Classes

ShopifyAppBridge
Manages the lifecycle of the Shopify App Bridge instance.
ShopifyAuth
Provides Shopify session token retrieval for backend authentication.
ShopifyHostHelper
Utility for reading Shopify-specific URL query parameters.
ShopifyLoading
Controls the App Bridge global Loading indicator.
ShopifyModal
Shows modal dialogs inside the Shopify Admin UI.
ShopifyRedirect
Handles navigation and redirects inside the Shopify Admin.
ShopifyTitleBar
Manages the top App Bridge TitleBar.
ShopifyToast
Shows toast notifications inside the Shopify Admin UI.

Enums

AdminSection
Shopify Admin resource section names used with RedirectTarget.adminSection.
RedirectTarget
Targets available for ShopifyRedirect actions.
ToastDuration
Duration presets (milliseconds) for ShopifyToast.