or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

agent.mdcomponents.mdentropy-sources.mdfingerprinting.mdindex.md
tile.json

fingerprinting.mddocs/

Fingerprint Generation

Visitor identification system that analyzes browser characteristics and generates stable visitor identifiers with confidence assessment and detailed component analysis.

Capabilities

Get Method

Generates a unique visitor identifier by analyzing browser and device characteristics.

/**
 * Gets the visitor identifier and associated data
 * @param options - Optional configuration for fingerprint generation
 * @returns Promise resolving to complete fingerprint result
 */
get(options?: GetOptions): Promise<GetResult>;

interface GetOptions {
  /** 
   * Whether to print debug messages (deprecated)
   * @deprecated Use the debug option of load() instead
   */
  debug?: boolean;
}

interface GetResult {
  /** The unique visitor identifier string */
  visitorId: string;
  /** Confidence assessment for the identifier reliability */
  confidence: Confidence;
  /** Raw entropy components used to generate the identifier */
  components: UnknownComponents;
  /** Library version used for fingerprint generation */
  version: string;
}

Usage Examples:

import FingerprintJS from '@fingerprintjs/fingerprintjs';

const fp = await FingerprintJS.load();

// Basic fingerprint generation
const result = await fp.get();
console.log('Visitor ID:', result.visitorId);
console.log('Confidence:', result.confidence.score);
console.log('Version:', result.version);

// Access individual components
Object.entries(result.components).forEach(([name, component]) => {
  if ('value' in component) {
    console.log(`${name}:`, component.value, `(${component.duration}ms)`);
  } else {
    console.log(`${name}: Error -`, component.error);
  }
});

Confidence Assessment

Statistical confidence scoring system that evaluates the reliability of visitor identifiers.

interface Confidence {
  /** 
   * Confidence score between 0 and 1
   * Higher values indicate more reliable identification
   */
  score: number;
  /** 
   * Human-readable explanation of the confidence assessment
   * Includes information about Pro version capabilities
   */
  comment?: string;
}

Confidence Score Interpretation:

  • 0.7+: High confidence (rare platforms like desktop Linux)
  • 0.6: Good confidence (Windows platforms)
  • 0.5: Moderate confidence (macOS, older WebKit)
  • 0.4: Lower confidence (Android devices)
  • 0.3: Lowest confidence (newer Safari/WebKit)

Usage Examples:

const result = await fp.get();

if (result.confidence.score > 0.6) {
  console.log('High confidence identification');
} else if (result.confidence.score > 0.4) {
  console.log('Moderate confidence identification');
} else {
  console.log('Lower confidence identification');
}

// Display confidence details
console.log('Confidence details:', result.confidence.comment);

Component Structure

Individual entropy components collected during fingerprint generation.

interface Component<T> {
  value: T;
  duration: number;
} | {
  error: unknown;
  duration: number;
}

type UnknownComponents = Record<string, Component<unknown>>;

Component Access Patterns:

const result = await fp.get();

// Check for successful component collection
if ('value' in result.components.canvas) {
  console.log('Canvas fingerprint:', result.components.canvas.value);
  console.log('Collection time:', result.components.canvas.duration, 'ms');
}

// Handle component errors
if ('error' in result.components.webgl) {
  console.log('WebGL collection failed:', result.components.webgl.error);
}

// Iterate through all components
Object.entries(result.components).forEach(([name, component]) => {
  const status = 'value' in component ? 'Success' : 'Error';
  console.log(`${name}: ${status} (${component.duration}ms)`);
});

Visitor ID Characteristics

The generated visitor identifier has specific characteristics designed for stability and uniqueness:

Stability Features:

  • Persists across browser sessions
  • Maintained in incognito/private browsing mode
  • Survives browser data clearing (cookies, localStorage, etc.)
  • Consistent across different tabs and windows

Usage Patterns:

const result = await fp.get();

// Store visitor ID for analytics
localStorage.setItem('analytics_id', result.visitorId);

// Use for fraud detection
if (await isKnownMaliciousId(result.visitorId)) {
  console.warn('Potentially fraudulent visitor detected');
}

// Track returning visitors
if (previousVisitorId === result.visitorId) {
  console.log('Returning visitor identified');
}

Error Handling

Robust error handling for various failure scenarios during fingerprint generation.

try {
  const fp = await FingerprintJS.load();
  const result = await fp.get();
  
  // Check for partial failures in components
  const failedComponents = Object.entries(result.components)
    .filter(([_, component]) => 'error' in component)
    .map(([name, _]) => name);
    
  if (failedComponents.length > 0) {
    console.warn('Some components failed:', failedComponents);
  }
  
  return result.visitorId;
} catch (error) {
  console.error('Fingerprinting failed:', error);
  throw error;
}