{"_id":"@artsnoa/ipc-sdk","_rev":"2-5a2b2b2dba5df0299530c4698843ef7f","name":"@artsnoa/ipc-sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@artsnoa/ipc-sdk","version":"1.0.0","keywords":["ipc","ip","geolocation","country","sdk","api"],"author":{"url":"mirseo","name":"Artsnoa.com","email":"aurora@artsnoa.com"},"license":"UNLICENSED","_id":"@artsnoa/ipc-sdk@1.0.0","maintainers":[{"name":"artsnoa","email":"aurora@artsnoa.com"}],"homepage":"https://ipc.artsnoa.com","bugs":{"url":"https://github.com/Artsnoa/IPC-Javascript-SDK/issues"},"dist":{"shasum":"f3d98d2efa1c20fd2304cbe0d1b82d711f1f3065","tarball":"https://registry.npmjs.org/@artsnoa/ipc-sdk/-/ipc-sdk-1.0.0.tgz","fileCount":7,"integrity":"sha512-bHNptpkMpDcf4fQtfUuG06DEF+KwUeIyyaXb/o2bZy11Qr1htYWOVH8NnKBUmqUwi9LKtjOTl6HHWq+f/mbyNg==","signatures":[{"sig":"MEUCIE2IpzclQOxl3Vn1wV881cE/Vtdm3RjuatS2tO2llmANAiEAy1aalBxyvi5+mhoWMthykvoZkyfI953hLR/+Sim86Ts=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35862},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"ae3ef1f41eb1f06430e5af248a3baad39959c106","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"artsnoa","email":"aurora@artsnoa.com"},"repository":{"url":"git+https://github.com/Artsnoa/IPC-Javascript-SDK.git","type":"git"},"_npmVersion":"11.6.2","description":"TypeScript SDK for IPC API - IP address and country lookup","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"packageManager":"pnpm@10.28.2","devDependencies":{"tsup":"^8.0.0","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ipc-sdk_1.0.0_1771225635522_0.6734511106503676","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@artsnoa/ipc-sdk","version":"1.0.1","description":"TypeScript SDK for IPC API - IP address and country lookup","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"pnpm run build","test":"echo \"Error: no test specified\" && exit 1"},"keywords":["ipc","ip","geolocation","country","sdk","api"],"author":{"name":"Artsnoa.com","email":"aurora@artsnoa.com","url":"mirseo"},"license":"UNLICENSED","repository":{"type":"git","url":"git+https://github.com/Artsnoa/IPC-Javascript-SDK.git"},"bugs":{"url":"https://github.com/Artsnoa/IPC-Javascript-SDK/issues"},"homepage":"https://ipc.artsnoa.com","packageManager":"pnpm@10.28.2","devDependencies":{"@types/node":"^22.0.0","tsup":"^8.0.0","typescript":"^5.6.0"},"engines":{"node":">=18.0.0"},"gitHead":"ab6a7a25e8a29a50d7f1d024729e97846a7e217b","_id":"@artsnoa/ipc-sdk@1.0.1","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-AJHw7apRJfC66iZv04FVfOQWI1mWwh7ndCxfqbpV512TZ8QvUgRS+caWGDTgfYJhyDhLh/bkAJww51b2/WOb8Q==","shasum":"e940b5c6b5ab74d6e05c8803bedb3ce1e50ea7db","tarball":"https://registry.npmjs.org/@artsnoa/ipc-sdk/-/ipc-sdk-1.0.1.tgz","fileCount":7,"unpackedSize":35998,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDhqqKg5KhZlauaBB3gsP+FuK01wJpUkrSQLTKgutZPOAiBrPJ3DNE0XqSlJpggYa1UMDltDzkef7lDwMJvi1co2Hg=="}]},"_npmUser":{"name":"artsnoa","email":"aurora@artsnoa.com"},"directories":{},"maintainers":[{"name":"artsnoa","email":"aurora@artsnoa.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ipc-sdk_1.0.1_1771227399957_0.9509677749042393"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-16T07:07:15.441Z","modified":"2026-02-16T07:36:40.241Z","1.0.0":"2026-02-16T07:07:15.681Z","1.0.1":"2026-02-16T07:36:40.114Z"},"bugs":{"url":"https://github.com/Artsnoa/IPC-Javascript-SDK/issues"},"author":{"name":"Artsnoa.com","email":"aurora@artsnoa.com","url":"mirseo"},"license":"UNLICENSED","homepage":"https://ipc.artsnoa.com","keywords":["ipc","ip","geolocation","country","sdk","api"],"repository":{"type":"git","url":"git+https://github.com/Artsnoa/IPC-Javascript-SDK.git"},"description":"TypeScript SDK for IPC API - IP address and country lookup","maintainers":[{"name":"artsnoa","email":"aurora@artsnoa.com"}],"readme":"# IPC Artsnoa JavaScript SDK\r\n\r\nOfficial JavaScript/TypeScript SDK for [ipc.artsnoa.com](https://ipc.artsnoa.com) API - Get your IP address and location information.\r\n\r\n## Features\r\n\r\n- Full TypeScript support with type definitions\r\n- Simple and intuitive API\r\n- Comprehensive error handling\r\n- Works in Node.js environments\r\n- Minimal dependencies\r\n- ESM and CommonJS support\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @artsnoa/ipc-sdk\r\n```\r\n\r\nOr with pnpm:\r\n\r\n```bash\r\npnpm add @artsnoa/ipc-sdk\r\n```\r\n\r\nOr with yarn:\r\n\r\n```bash\r\nyarn add @artsnoa/ipc-sdk\r\n```\r\n\r\n## Quick Start\r\n\r\n```javascript\r\nimport { IPCClient } from '@artsnoa/ipc-sdk';\r\n\r\n// Initialize client (API key is optional)\r\nconst client = new IPCClient({ apiKey: 'YOUR_API_KEY' });\r\n\r\n// Get detailed IP information\r\nconst details = await client.getIPDetails();\r\nconsole.log(`Your IP: ${details.ip}, Country: ${details.country}`);\r\n```\r\n\r\n## Usage Examples\r\n\r\n### Basic Usage\r\n\r\n```javascript\r\nimport { IPCClient } from '@artsnoa/ipc-sdk';\r\n\r\n// Create client with API key\r\nconst client = new IPCClient({ apiKey: 'YOUR_API_KEY' });\r\n\r\n// Get IP details\r\nconst data = await client.getIPDetails();\r\nconsole.log(`IP: ${data.ip}`);\r\nconsole.log(`Country: ${data.country}`);\r\n\r\n// Without API key\r\nconst publicClient = new IPCClient();\r\nconst publicData = await publicClient.getIPDetails();\r\nconsole.log(`Your IP: ${publicData.ip}`);\r\n```\r\n\r\n### TypeScript Usage\r\n\r\n```typescript\r\nimport { IPCClient, IPDetailsResponse } from '@artsnoa/ipc-sdk';\r\n\r\nconst client = new IPCClient({ apiKey: 'YOUR_API_KEY' });\r\n\r\n// Type-safe IP details\r\nconst details: IPDetailsResponse = await client.getIPDetails();\r\nconsole.log(`IP: ${details.ip}`);\r\nconsole.log(`User Agent: ${details.userAgent}`);\r\nconsole.log(`ASN: ${details.asn}`);\r\nconsole.log(`Country: ${details.country}`);\r\nconsole.log(`Currency: ${details.currency}`);\r\nconsole.log(`Languages: ${details.languages.join(', ')}`);\r\nconsole.log(`Timestamp: ${details.timestamp}`);\r\n```\r\n\r\n### SDK Version Information\r\n\r\n```javascript\r\nimport { IPCClient } from '@artsnoa/ipc-sdk';\r\n\r\nconst client = new IPCClient();\r\n\r\n// Get available SDK versions\r\nconst versions = await client.getSDKVersions();\r\nconsole.log(`JavaScript SDK: ${versions.javascript}`);\r\nconsole.log(`Python SDK: ${versions.python}`);\r\n```\r\n\r\n### Custom Configuration\r\n\r\n```javascript\r\nimport { IPCClient } from '@artsnoa/ipc-sdk';\r\n\r\n// Custom timeout and base URL\r\nconst client = new IPCClient({\r\n  apiKey: 'YOUR_API_KEY',\r\n  timeout: 15000, // 15 seconds in milliseconds\r\n  baseUrl: 'https://custom-domain.com'\r\n});\r\n\r\nconst data = await client.getIPDetails();\r\n```\r\n\r\n### CommonJS Usage\r\n\r\n```javascript\r\nconst { IPCClient } = require('@artsnoa/ipc-sdk');\r\n\r\nconst client = new IPCClient({ apiKey: 'YOUR_API_KEY' });\r\n\r\nclient.getIPDetails().then(data => {\r\n  console.log(`IP: ${data.ip}, Country: ${data.country}`);\r\n});\r\n```\r\n\r\n## Error Handling\r\n\r\nThe SDK provides a custom error class for handling API errors:\r\n\r\n```javascript\r\nimport { IPCClient, IPCError } from '@artsnoa/ipc-sdk';\r\n\r\nconst client = new IPCClient({ apiKey: 'YOUR_API_KEY' });\r\n\r\ntry {\r\n  const data = await client.getIPDetails();\r\n  console.log(`Your IP: ${data.ip}`);\r\n} catch (error) {\r\n  if (error instanceof IPCError) {\r\n    console.error(`IPC Error: ${error.message}`);\r\n    if (error.statusCode) {\r\n      console.error(`Status code: ${error.statusCode}`);\r\n    }\r\n    if (error.code) {\r\n      console.error(`Error code: ${error.code}`);\r\n    }\r\n  } else {\r\n    console.error(`Unexpected error: ${error}`);\r\n  }\r\n}\r\n```\r\n\r\n### TypeScript Error Handling\r\n\r\n```typescript\r\nimport { IPCClient, IPCError } from '@artsnoa/ipc-sdk';\r\n\r\nconst client = new IPCClient({ apiKey: 'YOUR_API_KEY' });\r\n\r\nasync function getIPSafely() {\r\n  try {\r\n    const data = await client.getIPDetails();\r\n    return data;\r\n  } catch (error) {\r\n    if (error instanceof IPCError) {\r\n      console.error(`API error: ${error.message}`);\r\n      console.error(`Status: ${error.statusCode ?? 'unknown'}`);\r\n    } else if (error instanceof Error) {\r\n      console.error(`Error: ${error.message}`);\r\n    }\r\n    throw error;\r\n  }\r\n}\r\n```\r\n\r\n## API Reference\r\n\r\n### IPCClient\r\n\r\n#### Constructor\r\n\r\n```typescript\r\nnew IPCClient(options?: IPCClientOptions)\r\n```\r\n\r\n**Parameters:**\r\n- `options` (IPCClientOptions): Configuration options\r\n  - `apiKey` (string, optional): API key for authentication\r\n  - `baseUrl` (string, optional): Base URL for the API. Defaults to `https://ipc.artsnoa.com`\r\n  - `timeout` (number, optional): Request timeout in milliseconds. Defaults to 10000 (10 seconds)\r\n\r\n**Example:**\r\n```javascript\r\nconst client = new IPCClient({\r\n  apiKey: 'YOUR_API_KEY',\r\n  timeout: 15000,\r\n  baseUrl: 'https://ipc.artsnoa.com'\r\n});\r\n```\r\n\r\n#### Methods\r\n\r\n##### `getIPDetails(): Promise<IPDetailsResponse>`\r\n\r\nGet detailed IP address and location information.\r\n\r\n**Returns:**\r\n- Promise that resolves to an object containing:\r\n  - `ip` (string): Your IP address\r\n  - `userAgent` (string): Browser user agent string\r\n  - `asn` (string): Autonomous System Number\r\n  - `country` (string): Country code (ISO 3166-1 alpha-2)\r\n  - `currency` (string): Country currency code (ISO 4217)\r\n  - `languages` (string[]): Array of supported language codes\r\n  - `timestamp` (string): Request timestamp (ISO 8601 format)\r\n  - `version` (string): API version\r\n\r\n**Throws:**\r\n- `IPCError`: When the API request fails or returns an invalid response\r\n\r\n**Example:**\r\n```javascript\r\nconst details = await client.getIPDetails();\r\nconsole.log(`IP: ${details.ip}, Country: ${details.country}`);\r\nconsole.log(`ASN: ${details.asn}, Currency: ${details.currency}`);\r\n```\r\n\r\n##### `getSDKVersions(): Promise<SDKVersionsResponse>`\r\n\r\nGet available SDK versions for different platforms.\r\n\r\n**Returns:**\r\n- Promise that resolves to an object containing:\r\n  - `javascript` (string): JavaScript/TypeScript SDK version\r\n  - `python` (string): Python SDK version\r\n\r\n**Throws:**\r\n- `IPCError`: When the API request fails or returns an invalid response\r\n\r\n**Example:**\r\n```javascript\r\nconst versions = await client.getSDKVersions();\r\nconsole.log(`JavaScript SDK: ${versions.javascript}`);\r\nconsole.log(`Python SDK: ${versions.python}`);\r\n```\r\n\r\n### Types\r\n\r\n#### IPCClientOptions\r\n\r\nConfiguration options for the IPCClient constructor.\r\n\r\n```typescript\r\ninterface IPCClientOptions {\r\n  apiKey?: string;\r\n  baseUrl?: string;\r\n  timeout?: number;\r\n}\r\n```\r\n\r\n#### IPDetailsResponse\r\n\r\nResponse structure from the `getIPDetails()` method.\r\n\r\n```typescript\r\ninterface IPDetailsResponse {\r\n  ip: string;\r\n  userAgent: string;\r\n  asn: string;\r\n  country: string;\r\n  currency: string;\r\n  languages: string[];\r\n  timestamp: string;\r\n  version: string;\r\n}\r\n```\r\n\r\n#### SDKVersionsResponse\r\n\r\nResponse structure from the `getSDKVersions()` method.\r\n\r\n```typescript\r\ninterface SDKVersionsResponse {\r\n  javascript: string;\r\n  python: string;\r\n}\r\n```\r\n\r\n#### IPCError\r\n\r\nCustom error class for IPC SDK errors.\r\n\r\n```typescript\r\nclass IPCError extends Error {\r\n  statusCode?: number;\r\n  code?: string;\r\n}\r\n```\r\n\r\n## Development\r\n\r\n```bash\r\n# Clone repository\r\ngit clone https://github.com/artsnoa/ipc-javascript-sdk.git\r\ncd ipc-javascript-sdk\r\n\r\n# Install dependencies\r\npnpm install\r\n\r\n# Build package\r\npnpm run build\r\n```\r\n\r\n## Requirements\r\n\r\n- Node.js 18.0.0 or higher\r\n- No external runtime dependencies\r\n\r\n## License\r\n\r\nMIT License\r\n\r\n## Support\r\n\r\n- Documentation: [https://github.com/artsnoa/ipc-javascript-sdk](https://github.com/artsnoa/ipc-javascript-sdk)\r\n- Issues: [https://github.com/artsnoa/ipc-javascript-sdk/issues](https://github.com/artsnoa/ipc-javascript-sdk/issues)\r\n- Email: aurora@artsnoa.com\r\n","readmeFilename":"README.md"}