Search code examples
shoutem

Shoutem Extension Settings


I tried to write a settings page for my shoutem extension. I followed the following tutorial and could get a working example using Shortcut Settings.

  1. How do I implement Extension Settings using the setttingsPage tag in the extension.json file? Unfortunately I could not find any tutorial for that.
  2. How do I access those extension setting values in my own extension (e.g. inside app.js)? I was able to access them in my own screen with: const { shortcut } = this.props; const { greeting } = shortcut.settings; But how do I do it inside app.js for example

Solution

    1. Use settingsPages in the root of extensions.json. The example you can find in our Shopify extensions and here's the reference for extension.json.

    2. To get extension settings, use getExtensionSettings selector. The example you can find in the app/app.js of our Shopify extension.