How To Implement For Magento PWA: A Step-by-step Guide

Implement For Magento PWA

Integrating with your Magento Progressive Web App (PWA) empowers you to offer tailored recommendations and track sales effectively. This blog post will guide you through the steps to seamlessly implement for Magento PWA, enabling you to enhance customer engagement and boost conversions.

Why Integration With Magento PWA?

Integrating with Magento PWA brings several key benefits to your online store:

  1. Personalized Recommendations: provides powerful recommendation widgets that can be seamlessly integrated into your shopping cart page, category page, and product page. These widgets enable you to display personalized product recommendations to your customers, enhancing cross-selling and upselling opportunities.
  2. Enhanced Sales Tracking: offers robust sales tracking capabilities, allowing you to gather valuable insights into customer behavior and measure the effectiveness of your marketing campaigns. By tracking sales data, you can optimize your strategies and drive revenue growth.

Key Features For Integration

Before diving into the implementation process, let’s explore the key features offers for seamless integration with Magento PWA:
  1. Recommendations Widget: The recommendations widget enables you to display personalized product recommendations dynamically. Implement it on the cart, category, and product pages to drive customer engagement and conversions.
  2. Store Data Synchronization: provides a synchronization process to ensure your Magento PWA is connected seamlessly, enabling the platform to retrieve and utilize relevant data effectively.

7 Steps To Implement For Magento PWA

1. Create a Clerk Account and Sign in

Begin by creating a account and signing in to the dashboard.

2. Add Store

integrate with magento pwa

After logging in to, the first step is to add your store:

  • Provide the Name and Domain of your webshop
  • Choose Magento 2 as the Platform
  • Select your Currency
  • Click Add New Store to proceed

3. Install and Configure the Extension

To integrate with your Magento PWA, you need to install and configure the extension. Follow these steps:

  • Run the following commands in your terminal:
composer require clerk/magento2
php bin/magento module:enable Clerk_Clerk
php bin/magento setup:upgrade
php bin/magento setup:di:compile
  • After the extension is installed, configure it by navigating to Store → Configuration → Clerk and entering your API key. magento 2 pwa

4. Sync your store

After configuring the extension, it’s important to synchronize your Magento store with pwa integration guide
  • Go back to the Setup Guide in the dashboard and click Sync Your Data.
  • Enter your store details and click Start Sync to initiate the synchronization process. This step ensures that your store’s data is connected with
implement clerk io for magento pwa github

5. Set up and Configure the Recommendations Widget

Refer to the Getting Started with Recommendations on Magento 2 to:

  • create recommendation sliders
  • define widget contents
  • configure content display through the Magento backend
Recommendations on Magento 2 Recommendations

6. Programmatically Display the Recommendations Widget

To programmatically show the recommendations widget on the cart, category, and product pages, you need to perform the following steps:

Create a module to retrieve the widget content configuration from the Magento backend.

  • Define the configuration variables in the di.xml file.
  • Create the schema.graphqls file with the required fields for API retrieval.

Develop an add-on for PWA to query the store configuration data and fetch the widget content.

  • GraphQl query to retrieve store configuration data.
  • Some custom hooks to query to Clerk API endpoint to fetch the widget content data.
  • Extended components from the PWA core component, with programmatically targetable interceptors that call the custom hooks and insert content data based on the configuration.
  • Some stylesheets to match with the current theme.

Related code:

<!-- Define the configuration variable in the di.xml file. -->
<type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider">
            <argument name="extendedConfigData" xsi:type="array">
                <item name="clerk_general_public_key" xsi:type="string">clerk/general/public_key</item>
                <item name="clerk_category_enabled" xsi:type="string">clerk/category/enabled</item>
                <item name="clerk_category_content" xsi:type="string">clerk/category/content</item>
                <item name="clerk_product_enabled" xsi:type="string">clerk/product/enabled</item>
                <item name="clerk_product_content" xsi:type="string">clerk/product/content</item>
                <item name="clerk_cart_enabled" xsi:type="string">clerk/cart/enabled</item>
                <item name="clerk_cart_content" xsi:type="string">clerk/cart/content</item>
//Create the schema.grapqls file
type StoreConfig {
    clerk_general_public_key: String @doc(description: "clerk public key")
    clerk_category_enabled: Boolean @doc(description: "clerk category content status")
    clerk_category_content: String @doc(description: "clerk category content class")
    clerk_product_enabled: Boolean @doc(description: "clerk product content status")
    clerk_product_content: String @doc(description: "clerk product content class")
    clerk_cart_enabled: Boolean @doc(description: "clerk cart content status")
    clerk_cart_content: String @doc(description: "clerk cart content status")
//GraphQl query for retrieving store configuration data.
export const GET_STORE_CONFIG_DATA = gql`
    query getStoreConfigClerk {
        # eslint-disable-next-line @graphql-eslint/require-id-when-available
        storeConfig {

7. Enable Sales Tracking Programmatically

To implement sales tracking with in your Magento PWA, following the steps below:

  • Create components and talons to extend the core Venia theme files and handle API calls for tracking sales to’s endpoint to clerk after an order is placed.
  • Extend theme files related to your payment methods, such as SagePay and Stripe, to incorporate sales tracking.
  • Extend @magento/peregrine/lib/store/actions/checkout/asyncActions.js to integrate the necessary functionality.
clerk magento 2

By following these steps, you can successfully integrate with your Magento PWA and leverage its powerful features to enhance the shopping experience for your customers.

A Showcase Example

For a visual representation of the integration in action, visit our demo site.

  • Category Page
examples of in magento 2 pwa
  • Product Page on magento pwa product page
  • Shopping Cart Page
shopping cart page
  • Sales tracking
sales tracking

Final Words

Integrating with Magento PWA offers powerful benefits for your online store. By following the provided steps, you can seamlessly implement and enjoy personalized recommendations and effective sales tracking.

If you encounter any challenges during the integration process or prefer to have experts handle it for you, the Tigren team is here to help. With over 5 years of experience in Magento PWA development, we have in-depth knowledge and expertise to assist you. Whether you need to build a powerful Magento PWA from scratch, utilize a Magento PWA theme, or integrate it with third-party software, our team is ready to provide tailored solutions to meet your specific requirements.

Don’t hesitate to reach out to the Tigren team for expert assistance in maximizing the potential of your Magento PWA and ensuring a seamless integration with

Related Posts:

Cannot Preview A Campaign In Magento PWA Content Staging? Here’s How To Fix It