Supabase Auth: Get Currently logged user id

Get the user id of current active user in supabase. Supabase auth logged user’s id get. Supabase next js code to get current logged in user’s id.

import { useUser } from "@supabase/auth-helpers-react";


export default function DashboardHome() {

    const user = useUser()

    console.log("Active User id " : user?.id);    //this will give the user id in the console

}

About the Author: smartcoder

You might like

Leave a Reply

Your email address will not be published. Required fields are marked *