Scenes required for getSessionToken

Topic summary

A developer is questioning whether getSessionToken is necessary when using authenticatedFetch, since the session token appears to be automatically included.

Current Implementation:

  • Created two providers: SessionTokenProvider and AuthFetchProvider
  • Wrapping the app with both providers alongside AppProvider

Core Question:

  • If authenticatedFetch automatically grants/sends the session token, is the SessionTokenProvider redundant?
  • Seeking clarification on specific scenarios where manually obtaining the session token via getSessionToken would be required

Status: The question remains unanswered, with the developer looking for guidance on best practices for token management in Shopify app extensions.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

When using authenticatedFetch, is it not necessary to get the token from getSessionToken since it is sent with the SessionToken also set?

In order to make it available from anywhere, we have created the following Provider.

・SessionTokenProvider
・AuthFetchProvider

return (
<React.StrictMode>
<AppProvider i18n={{}}>
<SessionTokenProvider app={shopifyApp}>
<AuthFetchProvider fetchFunction={fetchFunction}>
<App />
</AuthFetchProvider>
</SessionTokenProvider>
</AppProvider>
</React.StrictMode>
);

I believe that authenticatedFetch will be granted automatically, so I do not need a SessionTokenProvider.
If it is necessary, I would like to know the scenario in which SessionToken is used.