Overview
TheWellPlayedProvider is the root component that wraps your application and provides access to WellPlayed’s authentication, GraphQL client, and API services.
Basic Setup
Wrap your application with theWellPlayedProvider component:
Configuration Props
Required Props
Your organization ID from the WellPlayed Console.
Application configuration object containing authentication settings.
Optional Props
Additional OIDC configuration options. This extends the
OidcProviderProps from @axa-fr/react-oidc.GraphQL client configuration options (excluding
token and organizationId which are managed automatically).Custom API base URL. Defaults to
"well-played.gg".Configuration for the typed API client (excluding
url, headers, batch, keepalive, and method which are managed automatically).useWellPlayed Hook
Access WellPlayed context anywhere in your application:Return Values
Your organization ID.
Configured Apollo Client instance for GraphQL queries.
Typed API client for making REST API calls.
Current OIDC access token (if user is authenticated).
The
useWellPlayed hook must be used within a component that’s wrapped by WellPlayedProvider, otherwise it will throw an error.Advanced Configuration
Custom API Base URL
For testing or custom deployments:With Custom OIDC Configuration
Source Reference
The provider implementation can be found in:wp.provider.tsx:135-151-WellPlayedProvidercomponentwp.provider.tsx:86-94-useWellPlayedhookwp.provider.tsx:20-75- Type definitions