Ask AI is now on the home page — ask a question and get a sourced answer from the Ory docs. You'll also find it in the bottom-right corner of any page.

Skip to main content

getLogoutFlow()

function getLogoutFlow(params: { returnTo?: string }): Promise<LogoutFlow>

Use this method in an app router page to create a new logout flow. This method works with server-side rendering.

Parameters

ParameterTypeDescription
params{ returnTo?: string; }The query parameters of the request.
params.returnTo?string-

Returns

Promise<LogoutFlow>

Example

import { getLogoutFlow } from "@ory/nextjs/app"

async function LogoutLink() {
const flow = await getLogoutFlow()

return <a href={flow.logout_url}>Logout</a>
}