Creates a local, branded AmplifyContext from the given resource
configuration.
Unlike Amplify.configure(), the returned context is not set as the
global context and no Hub events are dispatched. Category APIs that receive
this context (as their first positional argument) will use it instead of the
global one, enabling per-request context injection in server-side /
multi-tenant scenarios.
This is the aws-amplify-level wrapper around
createCoreAmplifyContext | @aws-amplify/core's createAmplifyContext.
The core factory intentionally does not inject default Cognito providers
(it sits below @aws-amplify/auth in the dependency graph); this wrapper
closes that gap by resolving and injecting factory-style, per-context
Cognito token/credentials providers when the caller does not supply their own.
Because each call builds fresh provider instances, contexts created here do
not share the process-wide singleton providers used by
Amplify.configure() — two contexts remain isolated from one another.
Storage behaviour mirrors Amplify.configure(): tokens are persisted to
localStorage by default, or to cookies when { ssr: true } is set.
Creates a local, branded AmplifyContext from the given resource configuration.
Unlike
Amplify.configure(), the returned context is not set as the global context and no Hub events are dispatched. Category APIs that receive this context (as their first positional argument) will use it instead of the global one, enabling per-request context injection in server-side / multi-tenant scenarios.This is the
aws-amplify-level wrapper around createCoreAmplifyContext |@aws-amplify/core'screateAmplifyContext. The core factory intentionally does not inject default Cognito providers (it sits below@aws-amplify/authin the dependency graph); this wrapper closes that gap by resolving and injecting factory-style, per-context Cognito token/credentials providers when the caller does not supply their own. Because each call builds fresh provider instances, contexts created here do not share the process-wide singleton providers used byAmplify.configure()— two contexts remain isolated from one another.Storage behaviour mirrors
Amplify.configure(): tokens are persisted tolocalStorageby default, or to cookies when{ ssr: true }is set.