fingerprint-oss
Version:
A comprehensive JavaScript library for device fingerprinting and system information collection. Provides robust, deterministic fingerprinting for web applications with privacy-conscious design.
54 lines (53 loc) • 1.33 kB
TypeScript
export interface GeolocationInfo {
ipAddress: string;
country: {
isoCode: string;
name: string;
};
registeredCountry: {
isoCode: string;
name: string;
isInEuropeanUnion?: boolean;
};
city: {
name: string;
geonameId: number;
};
continent: {
code: string;
name: string;
};
subdivisions: Array<{
isoCode: string;
name: string;
}>;
location: {
accuracyRadius: number;
latitude: number;
longitude: number;
timeZone: string;
};
postal: {
code: string;
};
traits: {
isAnonymous: boolean;
isAnonymousProxy: boolean;
isAnonymousVpn: boolean;
isAnycast: boolean;
isHostingProvider: boolean;
isLegitimateProxy: boolean;
isPublicProxy: boolean;
isResidentialProxy: boolean;
isSatelliteProvider: boolean;
isTorExitNode: boolean;
ipAddress: string;
network: string;
};
}
/**
* Fetch geolocation information for the current user's IP address.
* Always returns valid GeolocationInfo data, falling back to mock data if needed.
* @returns Geolocation information (never null)
*/
export declare function fetchGeolocationInfo(): Promise<GeolocationInfo>;