title: What is the best way to get shopOrigin from within Shopify react app?
body: <p><strong>Overview:</strong></p>
  <p>I am using Shopify's CLI to generate an embedded React app. I would like to be able to get the shopOrigin (see code below) from other pages within the application.</p>
  <p><strong>Problem:</strong></p>
  <p>I have attempted using <a href="https://github.com/marcuswestin/store.js/" rel="nofollow noreferrer">store-js</a> to store the shopOrigin. This works at first but it seems to clear when I navigate to any other pages within the application.</p>
  <p><strong>Note:</strong></p>
  <p>Since it is set properly in <code>_app.js</code> I feel that I should simply be able to get the shopOrigin further downstream (i.e. in my index page or any other page) without having to set it in storage.</p>
  <p>So, I am completely open to obtaining the shopOrigin a different way without storing it via store-js or any other storage mechanism.</p>
  <p>Nonetheless, here is my current code.</p>
  <p><strong>Code:</strong></p>
  <pre><code>// _app.js
  
  import store from &quot;store-js&quot;;
  // other imports
  
  class MyApp extends App {
    render() {
      const { Component, pageProps, shopOrigin } = this.props;
      store.set(&quot;shopUrl&quot;, shopOrigin);
      return (
        &lt;AppProvider i18n={translations}&gt;
          &lt;Provider
            config={{
              apiKey: API_KEY,
              shopOrigin: shopOrigin,
              forceRedirect: true,
            }}
          &gt;
            &lt;ClientRouter /&gt;
            &lt;MyProvider Component={Component} {...pageProps} /&gt;
          &lt;/Provider&gt;
        &lt;/AppProvider&gt;
      );
    }
  }
  </code></pre>
  <pre><code>// index.js
  
  import store from &quot;store-js&quot;;
  // other imports
  
  function Index(props) {
    console.log(&quot;SHOP URL IS HERE: &quot; + store.get(&quot;shopUrl&quot;));
  }
  </code></pre>