Integrate with Hydrogen

Hand-on guide on how to integrate Avada Cookie Consent seamlessly with Shopify Hydrogen store.

Step 1: How to set up your Hydrogen store

If you've already developed your Hydrogen store, you're all set! However, if you haven't started yet or are looking to test a Hydrogen store with Avada Cookie Consent, don't worry. You can easily set up a quick-start Hydrogen store by following this guide: Getting Started with Hydrogen.

If you are not on Shopify Plus plan but still want to test this out with the development store first. You can update your .env file with Storefront API key from your Custom App

SESSION_SECRET="foobar"
PUBLIC_STOREFRONT_API_TOKEN="YOUR_KEY"
PUBLIC_STORE_DOMAIN="YOUR_STORE.myshopify.com"

Step 2: Installation

npm install avada-cookie-bar-hydrogen-sdk-v2

# or

yarn add avada-cookie-bar-hydrogen-sdk-v2

Step 3: Implementation

In your app/root.jsx loader:

  1. Initialize Avada Cookie Consent in Root Layout

In your app/root.jsx:

  1. Add CSP whitelist:

Update your entry.server.jsx to include the CSP whitelist for Avada Cookie Consent:

Turn on the integration in-app

Now, let's head back to the Hydrogen integration screen.

Click 'Turn on' to integrate the Avada Consent banner with your Hydrogen store.

Test the integration

After these are implemented, you will see the Cookie banner displays on your custom storefront according to your settings. However, you can compare the banner on the custom storefront and the Online Store channel to make sure both are working properly.

Last updated