Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/elements/guides/04_configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ allows you to use the default UI but still configure certain behaviors and URLs
Define the project configuration in your application like this:

```ts title="projectConfig.ts"
import { AccountExperienceConfiguration } from "@ory/elements-react"
import { ProjectConfiguration } from "@ory/elements-react"

const projectConfig: AccountExperienceConfiguration = {
const projectConfig: ProjectConfiguration = {
default_locale: "en", // default locale for the UI
default_redirect_url: "https://example.com/dashboard", // URL to redirect after successful login or registration
error_ui_url: "https://example.com/error", // URL to handle errors
Expand Down Expand Up @@ -67,10 +67,10 @@ function App() {

### UI URLs

To set the URLs for various UI components, you can use the following properties in the `AccountExperienceConfiguration`:
To set the URLs for various UI components, you can use the following properties in the `ProjectConfiguration`:

```typescript title="projectConfig.ts"
const projectConfig: AccountExperienceConfiguration = {
const projectConfig: ProjectConfiguration = {
login_ui_url: "https://example.com/login",
registration_ui_url: "https://example.com/register",
recovery_ui_url: "https://example.com/recovery",
Expand All @@ -84,7 +84,7 @@ These will be used when the respective actions are triggered, such as when a use
account and should match the URLs of your application's UI. You can also set the `error_ui_url` to handle errors in a custom way:

```typescript title="projectConfig.ts"
const projectConfig: AccountExperienceConfiguration = {
const projectConfig: ProjectConfiguration = {
error_ui_url: "https://example.com/error",
// ....
}
Expand All @@ -95,7 +95,7 @@ const projectConfig: AccountExperienceConfiguration = {
To set the logos for the light theme, you can use the following properties:

```typescript title="projectConfig.ts"
const projectConfig: AccountExperienceConfiguration = {
const projectConfig: ProjectConfiguration = {
logo_light_url: "https://example.com/logo-light.png",
// ....
}
Expand All @@ -106,7 +106,7 @@ const projectConfig: AccountExperienceConfiguration = {
To set a default locale:

```typescript title="projectConfig.ts"
const projectConfig: AccountExperienceConfiguration = {
const projectConfig: ProjectConfiguration = {
default_locale: "en",
// ....
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
---
id: migration-0x
title: Migration from Ory Elements 0.x to 1.x
sidebar_label: Migration from 0.x to 1.x
id: upgrade
title: Upgrade Ory Elements
sidebar_label: Upgrading
---

# Upgrade Guide

## Ory Elements 1.1.0 to 1.2.0 upgrade guide

This guide will show you how to migrate from Ory Elements 1.1.0 to 1.2.0.

If you are current overriding components using the `components` prop, you may need to update your overrides to pass the correct
props to your custom components.

- `Node.Button`: Now receives additional props:
- `isSubmitting`: This prop indicates whether this button was used to submit the form and the form is currently submitting.
- `buttonProps`: This prop contains all other button-related props that should be spread onto the button element.
- `Node.Input`: Now receives additional props:
- `inputProps`: This prop contains all other input-related props that should be spread onto the input element.
- `Node.Checkbox`:
- `inputProps`: This prop contains all other checkbox-related props that should be spread onto the checkbox input element.
- `Node.ConsentScopeCheckbox`:
- `inputProps`: This prop contains all other checkbox-related props that should be spread onto the checkbox input element.
- `Node.Label`:
- `fieldError`: This prop contains the error message associated with the field, if any.
- Settings Pages:
- Each settings section now similarly receives the nodes with a `buttonProps` or `inputProps` prop, depending on the type of
node.

## Fixes

- If you were using the `RecoveryCodesSettings` component, there was a typo in the prop name for regenerating codes. The correct
prop name is now `regenerateButton` instead of `regnerateButton`.

See the full release notes here: [Ory Elements 1.2.0 Release Notes](https://github.com/ory/elements/releases/tag/v1.2.0)

## Ory Elements 0.x to 1.x Upgrade Guide

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```ts
function OryConfigurationProvider(props: {
children?: ReactNode
project?: Partial<AccountExperienceConfiguration>
project?: Partial<ProjectConfiguration>
sdk?: {
options?: Partial<ConfigurationParameters>
url?: string
Expand All @@ -15,14 +15,14 @@ The `OryConfigurationProvider` component provides the Ory Elements configuration

## Parameters

| Parameter | Type | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `props` | \{ `children?`: `ReactNode`; `project?`: `Partial`\<`AccountExperienceConfiguration`\>; `sdk?`: \{ `options?`: `Partial`\<`ConfigurationParameters`\>; `url?`: `string`; \}; \} | The properties for the OryConfigurationProvider component. |
| `props.children?` | `ReactNode` | - |
| `props.project?` | `Partial`\<`AccountExperienceConfiguration`\> | This configuration is used to customize the behavior and appearance of Ory Elements. |
| `props.sdk?` | \{ `options?`: `Partial`\<`ConfigurationParameters`\>; `url?`: `string`; \} | The Ory SDK configuration to use. If not provided, the SDK URL will be determined automatically based on the environment. Always required for production environments. |
| `props.sdk.options?` | `Partial`\<`ConfigurationParameters`\> | Additional parameters for the Ory SDK configuration. This can include options like headers, credentials, and other settings. |
| `props.sdk.url?` | `string` | The URL the Ory SDK should connect to. This is typically the base URL of your Ory instance. |
| Parameter | Type | Description |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `props` | \{ `children?`: `ReactNode`; `project?`: `Partial`\<[`ProjectConfiguration`](../interfaces/ProjectConfiguration.md)\>; `sdk?`: \{ `options?`: `Partial`\<`ConfigurationParameters`\>; `url?`: `string`; \}; \} | The properties for the OryConfigurationProvider component. |
| `props.children?` | `ReactNode` | - |
| `props.project?` | `Partial`\<[`ProjectConfiguration`](../interfaces/ProjectConfiguration.md)\> | This configuration is used to customize the behavior and appearance of Ory Elements. |
| `props.sdk?` | \{ `options?`: `Partial`\<`ConfigurationParameters`\>; `url?`: `string`; \} | The Ory SDK configuration to use. If not provided, the SDK URL will be determined automatically based on the environment. Always required for production environments. |
| `props.sdk.options?` | `Partial`\<`ConfigurationParameters`\> | Additional parameters for the Ory SDK configuration. This can include options like headers, credentials, and other settings. |
| `props.sdk.url?` | `string` | The URL the Ory SDK should connect to. This is typically the base URL of your Ory instance. |

## Returns

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# isUiNodeAnchor()

```ts
function isUiNodeAnchor(node: UiNode): node is UiNodeAnchor
```

## Parameters

| Parameter | Type |
| --------- | -------- |
| `node` | `UiNode` |

## Returns

`node is UiNodeAnchor`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# isUiNodeDiv()

```ts
function isUiNodeDiv(node: UiNode): node is UiNodeDiv
```

## Parameters

| Parameter | Type |
| --------- | -------- |
| `node` | `UiNode` |

## Returns

`node is UiNodeDiv`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# isUiNodeImage()

```ts
function isUiNodeImage(node: UiNode): node is UiNodeImage
```

## Parameters

| Parameter | Type |
| --------- | -------- |
| `node` | `UiNode` |

## Returns

`node is UiNodeImage`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# isUiNodeInput()

```ts
function isUiNodeInput(node: UiNode): node is UiNodeInput
```

## Parameters

| Parameter | Type |
| --------- | -------- |
| `node` | `UiNode` |

## Returns

`node is UiNodeInput`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# isUiNodeScript()

```ts
function isUiNodeScript(node: UiNode): node is UiNodeScript
```

## Parameters

| Parameter | Type |
| --------- | -------- |
| `node` | `UiNode` |

## Returns

`node is UiNodeScript`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# isUiNodeText()

```ts
function isUiNodeText(node: UiNode): node is UiNodeText
```

## Parameters

| Parameter | Type |
| --------- | -------- |
| `node` | `UiNode` |

## Returns

`node is UiNodeText`
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# resolvePlaceholder()

```ts
function resolvePlaceholder(text: UiText, intl: IntlShape): string
```

## Parameters

| Parameter | Type |
| --------- | ----------- |
| `text` | `UiText` |
| `intl` | `IntlShape` |

## Returns

`string`
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# useResendCode()

```ts
function useResendCode(): {
resendCode: () => void
resendCodeNode: undefined | UiNode
}
```

useResendCode provides a callback to trigger a code resend in the current flow.

You may use this hook to implement a "Resend Code" button in your forms.

If the current flow does not support code resending, `resendCodeNode` will be `undefined` and `resendCode` will be a no-op.

Example:

```tsx
const { resendCode, resendCodeNode } = useResendCode();

return (
{resendCodeNode && (
<button onClick={resendCode}>Resend Code</button>
)}
)
```

## Returns

```ts
{
resendCode: () => void;
resendCodeNode: undefined | UiNode;
}
```

the callback to trigger a code resend

| Name | Type | Default value |
| ---------------- | ----------------------- | -------------- |
| `resendCode()` | () => `void` | `handleResend` |
| `resendCodeNode` | `undefined` \| `UiNode` | - |
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
---
id: index
title: "@ory/elements-react"
sidebar_label: "@ory/elements-react"
---

# @ory/elements-react

This package provides the core functionality for Ory Elements in React.
Expand All @@ -21,6 +15,7 @@ This package provides the core functionality for Ory Elements in React.
- [OryElementsConfiguration](interfaces/OryElementsConfiguration.md)
- [OryMessageContentProps](interfaces/OryMessageContentProps.md)
- [OryMessageRootProps](interfaces/OryMessageRootProps.md)
- [ProjectConfiguration](interfaces/ProjectConfiguration.md)
- [RecoveryFlowContainer](interfaces/RecoveryFlowContainer.md)
- [RegistrationFlowContainer](interfaces/RegistrationFlowContainer.md)
- [SettingsFlowContainer](interfaces/SettingsFlowContainer.md)
Expand All @@ -33,6 +28,7 @@ This package provides the core functionality for Ory Elements in React.
- [FormStateAction](type-aliases/FormStateAction.md)
- [FormValues](type-aliases/FormValues.md)
- [IntlConfig](type-aliases/IntlConfig.md)
- [NodeProps](type-aliases/NodeProps.md)
- [OnSubmitHandlerProps](type-aliases/OnSubmitHandlerProps.md)
- [OryCardAuthMethodListItemProps](type-aliases/OryCardAuthMethodListItemProps.md)
- [OryCardContentProps](type-aliases/OryCardContentProps.md)
Expand All @@ -49,12 +45,19 @@ This package provides the core functionality for Ory Elements in React.
- [OryFormSectionFooterProps](type-aliases/OryFormSectionFooterProps.md)
- [OryFormSsoRootProps](type-aliases/OryFormSsoRootProps.md)
- [OryNodeAnchorProps](type-aliases/OryNodeAnchorProps.md)
- [OryNodeButtonButtonProps](type-aliases/OryNodeButtonButtonProps.md)
- [OryNodeButtonProps](type-aliases/OryNodeButtonProps.md)
- [OryNodeCaptchaProps](type-aliases/OryNodeCaptchaProps.md)
- [OryNodeCheckboxInputProps](type-aliases/OryNodeCheckboxInputProps.md)
- [OryNodeCheckboxProps](type-aliases/OryNodeCheckboxProps.md)
- [OryNodeConsentScopeCheckboxProps](type-aliases/OryNodeConsentScopeCheckboxProps.md)
- [OryNodeImageProps](type-aliases/OryNodeImageProps.md)
- [OryNodeInputInputProps](type-aliases/OryNodeInputInputProps.md)
- [OryNodeInputProps](type-aliases/OryNodeInputProps.md)
- [OryNodeLabelProps](type-aliases/OryNodeLabelProps.md)
- [OryNodeSelectInputProps](type-aliases/OryNodeSelectInputProps.md)
- [OryNodeSelectProps](type-aliases/OryNodeSelectProps.md)
- [OryNodeSettingsButton](type-aliases/OryNodeSettingsButton.md)
- [OryNodeSsoButtonProps](type-aliases/OryNodeSsoButtonProps.md)
- [OryNodeTextProps](type-aliases/OryNodeTextProps.md)
- [OryPageHeaderProps](type-aliases/OryPageHeaderProps.md)
Expand All @@ -66,13 +69,33 @@ This package provides the core functionality for Ory Elements in React.
- [OrySettingsTotpProps](type-aliases/OrySettingsTotpProps.md)
- [OrySettingsWebauthnProps](type-aliases/OrySettingsWebauthnProps.md)
- [OryToastProps](type-aliases/OryToastProps.md)
- [UiNodeAnchor](type-aliases/UiNodeAnchor.md)
- [UiNodeDiv](type-aliases/UiNodeDiv.md)
- [UiNodeFixed](type-aliases/UiNodeFixed.md)
- [UiNodeImage](type-aliases/UiNodeImage.md)
- [UiNodeInput](type-aliases/UiNodeInput.md)
- [UiNodeInputAttributesOption](type-aliases/UiNodeInputAttributesOption.md)
- [UiNodeInputAttributesWithOptions](type-aliases/UiNodeInputAttributesWithOptions.md)
- [UiNodeScript](type-aliases/UiNodeScript.md)
- [UiNodeText](type-aliases/UiNodeText.md)

## Variables

- [OryLocales](variables/OryLocales.md)

## Functions

- [isUiNodeAnchor](functions/isUiNodeAnchor.md)
- [isUiNodeDiv](functions/isUiNodeDiv.md)
- [isUiNodeImage](functions/isUiNodeImage.md)
- [isUiNodeInput](functions/isUiNodeInput.md)
- [isUiNodeScript](functions/isUiNodeScript.md)
- [isUiNodeText](functions/isUiNodeText.md)
- [resolvePlaceholder](functions/resolvePlaceholder.md)

## Components

- [Node](variables/Node.md)
- [OryCard](functions/OryCard.md)
- [OryCardContent](functions/OryCardContent.md)
- [OryCardFooter](functions/OryCardFooter.md)
Expand All @@ -90,14 +113,31 @@ This package provides the core functionality for Ory Elements in React.
- [OrySettingsCard](functions/OrySettingsCard.md)
- [OrySettingsFormSection](functions/OrySettingsFormSection.md)

## Events

- [OryConsentSuccessEvent](type-aliases/OryConsentSuccessEvent.md)
- [OryErrorEvent](type-aliases/OryErrorEvent.md)
- [OryErrorHandler](type-aliases/OryErrorHandler.md)
- [OryLoginSuccessEvent](type-aliases/OryLoginSuccessEvent.md)
- [OryRecoverySuccessEvent](type-aliases/OryRecoverySuccessEvent.md)
- [OryRegistrationSuccessEvent](type-aliases/OryRegistrationSuccessEvent.md)
- [OrySettingsSuccessEvent](type-aliases/OrySettingsSuccessEvent.md)
- [OrySuccessEvent](type-aliases/OrySuccessEvent.md)
- [OrySuccessHandler](type-aliases/OrySuccessHandler.md)
- [OryValidationErrorEvent](type-aliases/OryValidationErrorEvent.md)
- [OryValidationErrorHandler](type-aliases/OryValidationErrorHandler.md)
- [OryVerificationSuccessEvent](type-aliases/OryVerificationSuccessEvent.md)

## Hooks

- [useComponents](functions/useComponents.md)
- [useNodeSorter](functions/useNodeSorter.md)
- [useOryConfiguration](functions/useOryConfiguration.md)
- [useOryFlow](functions/useOryFlow.md)
- [useResendCode](functions/useResendCode.md)

## Utilities

- [OryTransientPayload](type-aliases/OryTransientPayload.md)
- [messageTestId](functions/messageTestId.md)
- [uiTextToFormattedMessage](functions/uiTextToFormattedMessage.md)
Loading
Loading