import { Configuration, V0alpha1Api } from '@ory/kratos-client';
const kratos = new V0alpha1Api(new Configuration({ basePath: 'https://playground.projects.oryapis.com/api/kratos/public/' }));

const route = (req: Request, res: Response) => {
  kratos.createSelfServiceLogoutFlowUrlForBrowsers(req.cookies['ory_kratos_session']).then(({data}) => {
    .then(({ data }) => {
      console.log(data.logout_url) // The logout URL

      // You can render the logout URL like so:
      // <a href="{{data.logout_url}}>Logout</a>
    })
}
