Skip to content

Instantly share code, notes, and snippets.

Last active January 3, 2021 04:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
_app.js with the app bridge layered in
import React from 'react';
import App from 'next/app';
import Head from 'next/head';
import { AppProvider } from '@shopify/polaris';
import { Provider } from '@shopify/app-bridge-react';
import '@shopify/polaris/dist/styles.css';
import translations from '@shopify/polaris/locales/en.json';
class MyApp extends App {
render() {
const { Component, pageProps, shopOrigin } = this.props;
const config = { apiKey: API_KEY, shopOrigin, forceRedirect: true };
return (
<title>Sample App</title>
<meta charSet="utf-8" />
<Provider config={config}>
<AppProvider i18n={translations}>
<Component {...pageProps} />
MyApp.getInitialProps = async ({ ctx }) => {
return {
export default MyApp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment