WellPlayedProvider
TheWellPlayedProvider component wraps your application to provide authentication, GraphQL client, and typed API client access throughout your React component tree.
Props
The organization ID from the Well Played Console.
Application configurations from the Well Played Console.
OIDC configurations. An object of type
Omit<OidcProviderProps, "configuration"> & { configuration: Omit<OidcConfiguration, "client_id" | "redirect_uri" | "scope" | "response_type" | "authority" | "authority_configuration" | "authority_timeout_wellknowurl_in_millisecond" | "authority_time_cache_wellknowurl_in_second"> }.GraphQL client configurations. An object of type
Omit<ClientProps, "token" | "organizationId">.API Base URL for the WellPlayed API.
Typed client configuration. An object of type
Omit<Parameters<typeof createTypedClient>[0], "url" | "headers" | "batch" | "keepalive" | "method">.The child components to render within the provider.
Usage Example
Type Definition
useWellPlayed
A hook that provides access to the WellPlayed context, including the organization ID, API clients, and access token.Returns
The organization ID configured in the provider.
The Apollo GraphQL client configured for the WellPlayed API.
The typed client for making type-safe API requests.
The current OIDC access token, if available.
Usage Example
Error Handling
This hook will throw an error if used outside of aWellPlayedProvider: