The Hanko Admin API is available in Hanko Pro and Enterprise plans. Check out our pricing page for more information.

This minimal example showcases how you can get user data using Admin API from the userID obtained from the JWT.

const getUserData = async () => {
  const adminAPIURL = process.env.ADMIN_API_URL;
  const adminAPIKey = process.env.ADMIN_API_KEY;
  const options = {
    method: "GET",
    headers: {
      Authorization: `Bearer ${adminAPIKey}`,
    },
  };

  const response = await fetch(`${adminAPIURL}/users/${userID}`, options);

  return response.json();
};

const userData = await getUserData();
console.log("user data:", userData);