How to use @shopify/app-bridge-utils - 3 common examples

To help you get started, we’ve selected a few @shopify/app-bridge-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / next-gen-auth-app-demo / app / javascript / components / App.js View on Github external
export default function App() {
  const client = new ApolloClient({
    link: new HttpLink({
      credentials: 'same-origin',
      fetch: authenticatedFetch(window.app), // created in shopify_app.js
      uri: '/graphql'
    }),
    cache: new InMemoryCache()
  });

  return (
github Shopify / next-gen-auth-app-demo / app / javascript / utilities / protectedFetch.js View on Github external
export default function protectedFetch(appBridge) {
  const jwtFetch = authenticatedFetch(appBridge);

  return async (uri, options) => {
    const response = await jwtFetch(uri, options);
    if (invalidUserAccessTokenError(response)) {
      const { code, hmac, shop, timestamp } = await getAuthCode(appBridge);
      const callback_uri = `auth/shopify/callback?code=${code}&hmac=${hmac}&shop=${shop}&timestamp=${timestamp}`

      const callback_response = await jwtFetch(callback_uri);
      if (callback_response.status == 200) {
        return jwtFetch(uri, options);
      }
    } else {
      return response;
    }
  };
}
github Shopify / shopify_app / lib / generators / shopify_app / install / templates / shopify_app_turbolinks.js View on Github external
async function retrieveToken(app) {
    window.sessionToken = await getSessionToken(app);
  }

@shopify/app-bridge-utils

**Shopify is doubling our engineering staff in 2021! [Join our team and work on libraries like this one.](https://smrtr.io/5GGrc)**

MIT
Latest version published 1 year ago

Package Health Score

45 / 100
Full package analysis

Similar packages