Going to Production
Ory Elements is designed to be used in production environments. However, there are a few things you should consider when going to production.
Base URL
Make sure to set sdk.url to the correct value. This is the URL of the Ory APIs of your project.
import { OryClientConfiguration } from "@ory/elements-react"
import { projectConfig } from "./projectConfig"
export const config: OryClientConfiguration = {
sdk: {
url: "https://$PROJECT_SLUG.projects.oryapis.com", // Or your custom domain
},
project: projectConfig,
}
Pass config to the flow components in the config prop, for example <Login flow={flow} config={config} />. You can also set
the NEXT_PUBLIC_ORY_SDK_URL environment variable instead.
Setting this value is important because it ensures that the Ory Elements SDK is able to communicate with the correct Ory API instance.
In contrast to development environments, Ory Elements and the Ory APIs should be hosted on the same second level domain to make sure that the cookies set by the Ory APIs are accessible by the Ory Elements SDK.
Read more about the SDK URL in the Configuration guide.