Skip to main content

OryProviderProps

type OryProviderProps = {
components: OryFlowComponents
config: OryClientConfiguration
onError?: OryErrorHandler
onSuccess?: OrySuccessHandler
onValidationError?: OryValidationErrorHandler
transientPayload?: OryTransientPayload
} & OryFlowContainer &
PropsWithChildren

Props type for the OryProvider component.

Type declaration

NameTypeDescription
componentsOryFlowComponentsThe components to use for rendering Ory flows. You can provide custom components to override the default Ory components.
configOryClientConfigurationThe Ory client configuration. This includes the SDK and project configuration.
onError?OryErrorHandlerOptional callback invoked when a flow error occurs (expired, security violation, etc.). Use this to track error rates and detect integration issues. Example onError={(event) => { if (event.type === "flow_expired") { analytics.track("flow_expired", { flowType: event.flowType }) } }}
onSuccess?OrySuccessHandlerOptional callback invoked on successful flow completion. Use this for session stitching and post-authentication analytics. Example <OryProvider config={config} flow={flow} flowType={FlowType.Login} components={components} onSuccess={async (event) => { if (event.flowType === FlowType.Login) { await mixpanel.identify(event.session.identity.id) } }} />
onValidationError?OryValidationErrorHandlerOptional callback invoked when the flow returns validation errors. Use this to track form friction in your analytics pipeline. Example onValidationError={(event) => { analytics.track("validation_error", { flow: event.flow.id }) }}
transientPayload?OryTransientPayloadOptional transient payload to include in all flow submissions. Accepts a static object or a function that receives form values at submission time and returns the payload. Values are merged with any transient payload fields from UI nodes (e.g., captcha), with user-provided values taking priority. Examples <OryProvider config={config} flow={flow} flowType={FlowType.Registration} components={components} transientPayload={{ locale: "en-US", referral_code: "ABC123" }} /> <OryProvider config={config} flow={flow} flowType={FlowType.Registration} components={components} transientPayload={(formValues) => ({ signup_method: String(formValues.method ?? "unknown"), })} />