Skip to content

Configuration

Javier Villanueva edited this page Feb 27, 2021 · 2 revisions

Magento Configuration

There are only 3 settings you will need to setup after installing the module, you can access them by going to Stores → Configuration → Media Lounge → Storyblok:

Enable

Whether the module is enabled or not.

API Key (required)

Your Storyblok API Key, you can get it from your Storyblok space by going to Settings → API-Keys.

Make sure the "Access Level" is set to "preview".

Webhook Secret (required)

Random string that we will use to authenticate that requests are coming from Storyblok, we recommend using a 20+ characters alphanumeric string.

After this is set make sure to use the same value in your Storyblok Space by going to Settings → General → Webhook secret.

Storyblok Configuration

In your Storyblok space make sure you set up the following settings:

Settings → General → Location (default environment)

The URL of your Magento 2 website, Storyblok will use this to load a preview of your store in the visual editor. You can add multiple URLs in the Preview urls setting as well.

If you have problems loading the website preview you might need to add ALLOW-FROM storyblok.com to your X-Frame-Options header. You can do this in your env.php file or in your web server configuration settings. If you are using Magento's CSP module in live mode this should work out of the box.

Settings → General → Webhooks

Make sure to set the following URL as both Story published & unpublished and Datasource entry saved: http://yourmagento.url/storyblok/cache/clean.

Under the hood Storyblok will make a POST request to your website and our module will use this to clear the cache for that specific Story ID, this is where the Webhook Secret setting is used so only requests coming from Storyblok are allowed to do this.