are there nothing in `@ory/nextjs` package that gi...
# general
h
are there nothing in
@ory/nextjs
package that gives access to
frontendAPI
on client side?
p
which endpoint are you trying to call?
h
.toSession()
p
you can use the useSession() hook from client side
but you need to configure cors acordingly
and also your component should be rendered inside a <SessionProvider>.
there is an example next app in the docs/github
h
I do have my component inside <SessionProvider>
The next app example only does server rendering for all pages
p
Copy code
"use client"


import { useSession } from "@ory/elements-react/client"
import "@ory/elements-react/theme/styles.css"

export default function ClientPage() {
  
  const { session } = useSession()

  return (
    <div className='flex flex-col gap-8 items-center mb-8'>
      <div className='space-y-4 max-w-2xl'>
        <h2>Session</h2>
        <pre className='p-4 rounded text-sm overflow-auto'>
          {JSON.stringify(session, null, 2)}
        </pre>
      </div>
    </div>
  )
}
👍 1
h
Thx.