Skip to main content

React Provider Adapters

@picsart/runtime/providers/react/*

Reference service-provider implementations that assemble service objects from Picsart's React ecosystem and bridge React contexts into the kernel's service contracts. React and React DOM are optional peer dependencies — non-React hosts never install them.

Two composition styles

Entry pointExportStyle
@picsart/runtime/providers/react/fullFullRuntimeProvidersDeclarative — every adapter configured via props
@picsart/runtime/providers/reactRuntimeProviders, useRuntimeServicesManual — bring your own adapter selection

FullRuntimeProviders wraps the tree in this order, then calls onServicesReady(services) with the assembled IRuntimeServices:

<FullRuntimeProviders ...props>
├── IntlProvider (localization)
├── GrowthAuthProvider (authentication)
├── PulseProvider (analytics)
├── DesignSystemProvider (notifier, dialog, theming)
├── ErrorBoundary (error boundary wrapper)
└── NoNetworkProvider (offline detection)


onServicesReady(services) → spread into createRuntime

Adapter modules

Each adapter is independently optional:

Entry pointBridges
.../adapters/growth-rc@picsart/growth-rc authentication context
.../adapters/pulse@pulse/react analytics context
.../adapters/intlPicsart localization
.../adapters/design-systemNotifier, dialog, theming
.../adapters/error-boundaryError boundary via @picsart/growth-rc
.../adapters/no-networkNetwork-status / offline detection
.../adapters/monetizationMonetization / checkout controls

Environment variables

The underlying Picsart libraries read process.env.REACT_APP_* at module-evaluation time — build-time constants, not runtime props. Define them via your bundler (Vite define, webpack DefinePlugin):

VariablePurpose
REACT_APP_NODE_ENVEnvironment mode
REACT_APP_API_URLAPI gateway base URL
REACT_APP_AI_WEBAI services gateway URL
REACT_APP_UPLOAD_API_URLUpload service base URL
REACT_APP_MINIAPPS_PLATFORM_SDKSDK environment (staging/production)
REACT_APP_X_APP_AUTHORIZATION_TOKENApplication-level Bearer token
REACT_APP_WS_URLWebSocket API base URL
REACT_APP_PICSART_BASE_DOMAINBase domain for cookies and redirects
REACT_APP_RECAPTCHA_PUBLIC_KEYreCAPTCHA Enterprise v3 site key
REACT_APP_GOOGLE_RECAPTCHA_SITE_KEY_V2reCAPTCHA v2 fallback site key

The useRuntimeServices hook

useRuntimeServices() reads the assembled services from context. Because each package entry point is a separate bundle, the hook and the provider must come from the same entry — see the context-identity caveat in Installation and the Embedded Public API.