Shopify App Bridge: What it is and why do you need it?

March 14, 2023
·
10 min read
·

If you are creating an embedded Shopify app, the Shopify App Bridge is a mandatory tool that you must use to publish your app on the App Store. While it is technically possible to create an embedded app without using Shopify App Bridge, such an app will not pass the app review. This article covers everything you need to know to get started with App Bridge.

Table of contents
  1. What is Shopify App Bridge and why do you need it?
  2. App Bridge is a tool required for developing Shopify apps embedded into the admin dashboard. It provides better app performance and mobile optimization, as well as a set of standard, app review-compliant user interface components.
  3. Advantages of Shopify App Bridge
  4. Using App Bridge offers improved performance, mobile optimization, and faster development through access to standard Shopify user interface components.
  5. Actions and Methods of Shopify App Bridge
  6. Developers can integrate App Bridge by using its actions and methods. Actions allow the display and interaction with user interface components, such as buttons, while methods can be used by the internal app logic.
  7. Shopify App Bridge and Polaris
  8. Polaris is a optional design system from Shopify that includes user interface components, icons, design patterns, various layouts, and more. Polaris can be used in combination with App Bridge.
  9. Shopify embedded app template
  10. To quickly start developing an embedded Shopify App with Shopify App Bridge, use a robust open-source app template available on GitHub – shopify app template go.

What is Shopify App Bridge and why do you need it?

Shopify is a popular e-commerce platform that enables entrepreneurs to easily create and manage online stores. Merchants can extend store functionality by integrating various apps, which can be found on the Shopify App Store. These apps are designed to optimize online stores, enhance the overall shopping experience for customers, and more.

Embedded vs Standalone apps

There are two types of Shopify apps: embedded and standalone. Embedded apps can be easily accessed through the store's admin dashboard, while standalone apps are located on other websites. To better understand the differences between Embedded and Standalone app, refer to Embedded vs Standalone Shopify Apps – Key Differences and How to Choose.

What is Shopify App Bridge?

Shopify App Bridge is a set of tools and APIs provided by Shopify that enable developers to build embedded Shopify apps. These apps can integrate and communicate with Shopify stores, providing a seamless user experience by being embedded within the Shopify admin interface. The App Bridge includes a variety of components that developers can use to build their apps, such as UI components for creating consistent interfaces.

With Shopify App Bridge, developers can create apps that perform a wide range of functions, such as adding new features to the Shopify store, enhancing the customer experience, automating tasks, and more. The App Bridge simplifies the app development process by handling many common tasks associated with building Shopify apps and helps ensure a high-quality user experience.

Is Shopify App Bridge required?

To publish an embedded Shopify app to the Shopify App Store, it is mandatory to use the App Bridge version 2.0 or higher. Failure to use the App Bridge will result in the app not passing the Shopify app review process and not being published. Additionally, the Embedded App SDK (EASDK) cannot be used as it is a deprecated technology.

Importantly, the App Bridge must be used to implement the entirety of an app functionality. Developing some parts of an application with App Bridge and others without it, or with other technologies, will make the app ineligible for publication on the Shopify App Store.

Advantages of Shopify App Bridge

App Bridge has a list of advantages for both merchants and developers.

Improved performance and user experience

App performance is a critical aspect of a merchant's user experience when using apps in the Shopify admin. Slow load times can dissuade merchants from adopting an app, increase bounce rates, and ultimately decrease overall usage.

With App Bridge, apps can load faster due to built-in Shopify optimization. Moreover, App Bridge reduces content layout shifts, which makes merchants perceive an app as faster and more responsive, even if the actual loading time does not change.

Out-of-the-box mobile optimization

Apps created with App Bridge are optimized for the Shopify Mobile app, which greatly improves the mobile experience for merchants. To enable mobile optimization for your app, follow these steps in your Partner Dashboard:

  1. Click Apps in your Partner Dashboard.
  2. Select the name of your app.
  3. Click App setup.
  4. In the Embedded app section, click Manage.
  5. Enable optimized loading for all users on live stores in the Optimize loading on mobile section.
Faster app development and publishing

Shopify App Bridge can significantly speed up the development of embedded Shopify Apps by providing developers with various pre-built components such as Button, Menu, and Navigation, among others.

Usage of Shopify App Bridge also increases the likelihood of successfully passing the app review process by enabling developers to easily comply with the Shopify App Design Guidelines through the use of provided App Bridge components. Adherence to these guidelines is mandatory for publishing an app on the Shopify App Store.

Enhanced security

When a merchant initiates an action on the app's user interface, such as by clicking a button, the interface sends a request to the server, which then executes the action. With App Bridge, each such request is automatically protected: once the merchant triggers the action, the App Bridge generates a unique token, which is sent to the server along with the request. The server then uses this token to verify that the request was sent from the intended store. As a result, the App Bridge provides protection against unauthorized access to the app.

Actions and Methods of Shopify App Bridge

Every Shopify app consists of two main parts: the client and the server. The client is the visual component of the application that merchants can see, while the server contains the application's logic and communicates with a Shopify store. For embedded apps, the client side must use the App Bridge. The App Bridge itself consists of actions and methods that developers can use to build embedded apps.

Actions

Actions provide a way for embedded applications to trigger events with a payload. Most of Shopify App Bridge’s functionality relies on actions.

For example, if your app needs to display a standard Shopify green button with a label, App Bridge actions make it easy to create this button component with just one line of code. Without actions, developers would need to write a lot of code to define the button's style.

In addition to simplifying development, App Bridge actions ensure that your app adheres to Shopify's design guidelines and will pass app review. Because App Bridge is an official Shopify tool, all of its components meet the necessary requirements by default.

Methods

Methods, on the other hand, are triggered internally by an embedded application itself, allowing the app to access various information necessary for its logic to function. For example, an app can use methods to react to internal errors or determine whether it is being used on a desktop or mobile device.

Shopify App Bridge and Polaris

Polaris is a component library provided by Shopify that offers various reusable UI elements and patterns, such as buttons, labels, icons, toggles, and more. Developers can use Polaris to create intuitive and good-looking Shopify Apps that adhere to Shopify App Design Guidelines.

Polaris offers a wider selection of UI components compared to Shopify App Bridge, and developers can replace App Bridge components with Polaris components if necessary. However, App Bridge must still be used for implementing the underlying application logic.

App Bridge can be considered the backbone of any embedded Shopify app. Polaris is an optional UI component library that can be used on top of the App Bridge.

Shopify officially encourages the use of Polaris for all types of apps.

Open-source Shopify embedded app template

To quickly start developing an embedded Shopify App with Shopify App Bridge, use a robust open-source app template available on GitHub - shopify app template go.

The template enables you to save development time by providing the necessary basics, such as the app structure, client-server communication, store installation logic, and minimal UI view.

Conclusion

App Bridge is a tool required for developing Shopify apps embedded into the admin dashboard. It provides better app performance and mobile optimization, as well as a set of standard, app review-compliant user interface components. App Bridge is compatible with Polaris, which includes a wider range of UI components, icons, and design patterns, but is optional. By using App Bridge, you can create reliable embedded Shopify applications.

Further reading
  1. How to Build a Shopify App: An In-Depth Guide
  2. Embedded vs Standalone Shopify Apps: Key Differences and How to Choose
  3. 8 Key Things to Know Before Developing a Shopify App

Elijah Atamas

CEO, Softcery
© 2023 Softcery. All rights reserved.