@datasentry/sdk
v1.0.0
Published
DataSentry JavaScript SDK — IP geolocation and threat intelligence for Node.js and the browser.
Maintainers
Readme
DataSentry JavaScript SDK
Dead simple IP geolocation and threat intelligence for Node.js and the browser.
Installation
npm install @datasentry/sdk
# or
yarn add @datasentry/sdkQuick Start
import { DataSentry } from '@datasentry/sdk';
const ds = new DataSentry({
apiKey: 'your_api_key' // or process.env.DATASENTRY_API_KEY
});
// Simple lookup
const result = await ds.lookup({ ip: '8.8.8.8' });
console.log(result.location.city); // "Mountain View"
console.log(result.security.threat_score); // 0 (Safe)Features
- Environment Agnostic: Works in Node.js, Browser, and Edge runtimes.
- Triple-Layer Optimized: Built to leverage DataSentry's global caching.
- Strictly Typed: Full TypeScript support.
- AI Ready: Optimized for use with AI agents and MCP.
API Reference
lookup(options)
ip: IP address to lookup.fields: Array of specific fields to return.nocache: Boolean to bypass cache.
bulk(ips)
ips: Array of IP addresses to look up in a single request.- Returns a
BulkResponsewith individual results per IP.
const bulkResult = await ds.bulk(['8.8.8.8', '1.1.1.1', '9.9.9.9']);
console.log(bulkResult.total); // 3
bulkResult.results.forEach(r => {
console.log(r.ip, r.status, r.data?.location?.country);
});usage()
- Get current quota and credit usage.
License
Proprietary.
