The following example uses useSessionList() to get a list of sessions that have been registered on the client device. The sessions property is used to show the number of times the user has visited the page.
app/home/page.tsx
'use client'import { useSessionList } from'@clerk/nextjs'exportdefaultfunctionPage() {const { isLoaded,sessions } =useSessionList()// Handle loading stateif (!isLoaded) return <div>Loading...</div>return ( <div> <p>Welcome back. You've been here {sessions.length} times before.</p> </div> )}