Migration from Ory Elements 0.x to 1.x
This guide will show you how to migrate from Ory Elements 0.x to 1.x.
Ory Elements 1.0 is a complete rewrite of the Ory Elements 0.x library. It is not backwards compatible with 0.x.
Migration from Ory Elements 0.x to 1.x
Update the package name
npm install @ory/elements-react
And change the import path to the new package name.
<UserAuthCard />
Instead of exporting a single UserAuthCard component, the 1.0 version exports a set of components for each flow.
- In most cases, you can simply replace
<UserAuthCard />with<Login />,<Registration />,<Recovery />,<Settings />, or<Verification />depending on the flow you are using. - Remove the
additionalPropsprop from the components and pass in the configuration object as a prop to each component. You can read more about the configuration in the configuration guide. - You no longer need to handle the onSubmit event of the components. The components now handle the form submission automatically based on the configuration object.
includeScriptsis no longer supported. You can remove it from props.cardImageis no longer supported. You can remove it from props. Use thelogo_light_urlproperty in the configuration object to set the logo.classNameis no longer supported. You can remove it from props. Read the theming guide to learn how to customize the look and feel of the components.titleis no longer supported. You can remove it from props. Read the configuration guide to learn how to set the title in the card header.subtitleis no longer supported. Instead, the card's subtitle will be determined dynamically based on the flow's state.
<UserConsentCard />
The <UserConsentCard /> component has been removed. You can now use the <Consent /> component to render the consent page.
- Change the
consentprop toconsentChallenge. cardImageis no longer supported. You can remove it from props. Use thelogo_light_urlproperty in the configuration object to set the logo.client_namewill be inferred from theconsentChallengeprop. You can remove it.requested_scopewill be inferred from theconsentChallengeprop. You can remove it.clientwill be inferred from theconsentChallengeprop. You can remove it.classNameis no longer supported. You can remove it from props. Read the theming guide to learn how to customize the look and feel of the components.
<UserErrorCard />
The <UserErrorCard /> component has been removed. You can now use the <Error /> component to render the error page.
titleis no longer supported. You can remove it from props.errornow supports more variants. In most cases you can pass in the same object, as before.backUrlhas been removed.cardImageis no longer supported. You can remove it from props. Use thelogo_light_urlproperty in the configuration object to set the logo.contactSupportEmailhas been removed.classNameis no longer supported. You can remove it from props. Read the theming guide to learn how to customize the look and feel of the components.
<UserLogoutCard />
The <UserLogoutCard /> component has been removed. You can now use the useLogoutFlow hook from the "@ory/nextjs/pages" package
to build your own logout flow component.
<UserSettingsCard />, <UserSettingsScreen.Nav /> & <UserSettingsScreen.Body />
The <UserSettingsCard /> component has been removed. You can now use the <Settings /> component to render the settings page.
classNameis no longer supported. You can remove it from props. Read the theming guide to learn how to customize the look and feel of the components.dividerClassNameis no longer supported. You can remove it from props. Read the theming guide to learn how to customize the look and feel of the components.includeScriptsis no longer supported. You can remove it from props.titleis no longer supported. You can remove it from props. Read the configuration guide to learn how to set the title in the card header.methodis no longer supported. You can remove it from props.