tall-cartoon-65452
06/26/2024, 9:02 AMchilly-king-10285
06/26/2024, 9:02 AMchilly-king-10285
06/26/2024, 9:03 AMFrontendApi
class from the @ory/client
package. Here is a sample code snippet: javascript import { Configuration, FrontendApi } from "@ory/client" const frontend = new FrontendApi( new Configuration({ basePath: `https://${process.env.ORY_PROJECT_SLUG}.<http://projects.oryapis.com|projects.oryapis.com>`, }), ) export async function createRecovery() { return await frontend.createNativeRecoveryFlow() }
This function createRecovery
will create a recovery flow for a user. Please note that you need to replace ${process.env.ORY_PROJECT_SLUG}
with your actual project slug. This code snippet is a part of the Ory Kratos JavaScript SDK. It's important to note that this function will only initiate the recovery flow. To actually create a recovery link, you would need to interact with the createRecoveryLinkForIdentity
endpoint of the Ory Kratos Admin API, which is not directly available in the JavaScript SDK. For more details, you can refer to the [Ory Kratos API Reference](https://www.ory.sh/docs/kratos/reference/api) and [Ory Kratos JavaScript SDK documentation](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#create-recovery-flow).