HomeLabsSite Metadata

Metadata Card

An card displaying real-time visitor information.

Inspired by Seline's founder letter.

Geolocation helper function for @nextjs server components.

import { headers } from "next/headers";
 
export function getGeoLocation() {
  const headersList = await headers();
 
  return {
    ip: headersList.get("x-real-ip") || "Unknown IP",
    country: headersList.get("x-vercel-ip-country") || "Unknown Country",
    city: headersList.get("x-vercel-ip-city") || "Unknown City",
  };
}
 
 
import { headers } from "next/headers";
 
export function getGeoLocation() {
  const headersList = await headers();
 
  return {
    ip: headersList.get("x-real-ip") || "Unknown IP",
    country: headersList.get("x-vercel-ip-country") || "Unknown Country",
    city: headersList.get("x-vercel-ip-city") || "Unknown City",
  };
}