@ipranker/sdk
Version:
Professional IP Intelligence and Device Fingerprinting SDK - Comprehensive fraud detection with single API call
78 lines (77 loc) • 1.93 kB
TypeScript
/**
* IPRanker SDK - Main Class
* Single API call for IP Intelligence analysis with automatic fingerprint + behavior collection
*/
import type { IPRankerOptions, AnalysisResult, AnalyzeOptions } from './types';
export declare class IPRanker {
private apiKey;
private apiClient;
private fingerprintCollector;
private behaviorCollector;
private deviceCollector;
private options;
private callbacks;
constructor(apiKey: string, options?: Partial<IPRankerOptions>);
/**
* Initialize SDK
*/
private _initialize;
/**
* Analyze current visitor - main method
* Collects fingerprint + behavioral data and sends to IPRanker API
*/
analyze(customOptions?: AnalyzeOptions): Promise<AnalysisResult>;
/**
* Get fingerprint data only (without full analysis)
*/
getFingerprint(): Promise<import("./types").FingerprintData>;
/**
* Get behavioral data only
*/
getBehaviorData(): import("./types").BehaviorData;
/**
* Get device data only
*/
getDeviceData(): Promise<import("./types").DeviceData>;
/**
* Clear cache
*/
clearCache(): void;
/**
* Stop behavioral data collection and cleanup
*/
destroy(): void;
/**
* Collect behavioral data with timeout
*/
private _collectBehaviorWithTimeout;
/**
* Send request with auto-retry
*/
private _sendWithRetry;
/**
* Get cached result if available and not expired (per IP address)
*/
private _getCachedResult;
/**
* Cache result to localStorage (per IP address)
*/
private _cacheResult;
/**
* Clear cache from localStorage
*/
private _clearCache;
/**
* Handle errors
*/
private _handleError;
/**
* Debug logging
*/
private _log;
/**
* Delay utility
*/
private _delay;
}
export default IPRanker;