Skip to content

App Bridge React 4: Hook updates — drop useAuthenticatedFetch; update useAppBridge() usage #14

@mohab-sameh

Description

@mohab-sameh

Hooks changed significantly; useAppBridge() now returns the shopify global, and auth is wired to global fetch. (Shopify)

Before

const app = useAppBridge();
const fetch = useAuthenticatedFetch();

After

const shopify = useAppBridge();
// use shopify.toast / resourcePicker APIs; use global fetch for auth

Detect:

  • Imports/usage of useAuthenticatedFetch.
  • Old patterns assuming useAppBridge() returns app.

Edge cases:

  • SSR: useAppBridge() throws helpful errors if called outside browser context.

Reference:

Metadata

Metadata

Assignees

No one assigned

    Labels

    app-bridge-reactApp Bridge React transformationsbreaking-changeBreaking change requiring migration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions