Skip to main content

Using real data

info

Using real data is only available to early access partners. Apply here to join the early access program.

Disabling sandbox mode

To allow your Shop Mini to access and query your development stores or any store with your Shopify app installed, you need to disable the sandbox mode.

In order to do so, remove the following line in index.tsx file in your root directory of your project source code:

        <ShopActionsProvider value={actions}>
<Wrapper
initialApiKeys={initialApiKeys}
apiHeaders={apiHeaders}
theme={lightTheme}
params={params}
entryPoint={entryPoint}
entryPointParams={entryPointParams}
environment={environment}
- enableApiSandbox
>

External requests

Shop Minis run in a restricted environment and external requests are only permitted on a case-by-case basis. They must fetch data using the minisFetch helper and domains must be listed in the trusted_domains field of the manifest. However, during development you can make requests to localhost or use fetch directly.

import {minisFetch} from '@shopify/shop-minis-platform-sdk'
try {
const res = await minisFetch('http://localhost:3000/endpoint', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
param: 'value',
}),
})

handleSuccess(await res.json())
} catch (error) {
handleError(error)
}