{"_id":"@appitude/sendivent","_rev":"5-f7a957b7c04436d64c91b520af1b9df9","name":"@appitude/sendivent","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@appitude/sendivent","version":"0.1.0","keywords":["sendivent","email","sms","slack","typescript"],"author":{"name":"Sendivent"},"license":"MIT","_id":"@appitude/sendivent@0.1.0","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"homepage":"https://github.com/sendivent/sdk-node#readme","bugs":{"url":"https://github.com/sendivent/sdk-node/issues"},"dist":{"shasum":"981858b3b0049f4bd6da68d03779ca60d1893df9","tarball":"https://registry.npmjs.org/@appitude/sendivent/-/sendivent-0.1.0.tgz","fileCount":8,"integrity":"sha512-ttUeWOWvd97a/0iCONKqAfCEb2OGmhTmer0kz+Ttd9+a+wLyAJNj5m8C/wX6VMIJG80PIk0MHHo6/JJ60WC3wg==","signatures":[{"sig":"MEUCIGcxAOvHCQ4WPAE6OKyvpWq13xMbOKYCM2shWlzms+8pAiEAtpA6UmjKiJhbSD3NhUPgg8irZmjDBVWaxTXfJ7HTaN8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12304},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"a06bee19af2248c3c64e6f16657d44bc5b088ff7","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"oakleaf","email":"mathiaseklof@gmail.com"},"repository":{"url":"git+https://github.com/sendivent/sdk-node.git","type":"git"},"_npmVersion":"11.6.0","description":"Official TypeScript/JavaScript SDK for Sendivent - Multi-channel notification platform","directories":{},"_nodeVersion":"24.10.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sendivent_0.1.0_1763371888929_0.15655546326358483","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@appitude/sendivent","version":"0.2.0","keywords":["sendivent","email","sms","slack","typescript"],"author":{"name":"Sendivent"},"license":"MIT","_id":"@appitude/sendivent@0.2.0","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"homepage":"https://github.com/sendivent/sdk-node#readme","bugs":{"url":"https://github.com/sendivent/sdk-node/issues"},"dist":{"shasum":"24ec72b4e2f822bcbe40c3e8546351c6480e2a71","tarball":"https://registry.npmjs.org/@appitude/sendivent/-/sendivent-0.2.0.tgz","fileCount":8,"integrity":"sha512-RnTCHcdBAqs31Q0GWE6vwKx1vKxRr1AZMIX1uTxTqLL7bD9FONyxSzoLUKY1rkvj8TliCk2f159XASS3fEKZYg==","signatures":[{"sig":"MEYCIQDDkCAAefprKGyK2oeDDKKJxhWRRBl4LKOikcvuQFNlogIhAL9wye9qWF3pA9jkmjSCHrwxwz8uSBZcfO5tKM2c6Iuo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12307},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"6afd320934a327e329c536551214886e1174872a","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"oakleaf","email":"mathiaseklof@gmail.com"},"repository":{"url":"git+https://github.com/sendivent/sdk-node.git","type":"git"},"_npmVersion":"10.8.2","description":"Official TypeScript/JavaScript SDK for Sendivent - Multi-channel notification platform","directories":{},"_nodeVersion":"20.19.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sendivent_0.2.0_1764062590022_0.7800657226169294","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@appitude/sendivent","version":"0.2.1","keywords":["sendivent","email","sms","slack","typescript"],"author":{"name":"Sendivent"},"license":"MIT","_id":"@appitude/sendivent@0.2.1","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"homepage":"https://github.com/appitudeio/sendivent-node#readme","bugs":{"url":"https://github.com/appitudeio/sendivent-node/issues"},"dist":{"shasum":"e6af3cf174943c82af3e12e094726a1a5b893557","tarball":"https://registry.npmjs.org/@appitude/sendivent/-/sendivent-0.2.1.tgz","fileCount":8,"integrity":"sha512-/8dn+akNU1oAYWWa0VdurPzgtMEUYY1JnIrHlLHdB/XvH4tyDzlKP62iw52g6K48hi8xxNZhuPEiUVqvFe/i1A==","signatures":[{"sig":"MEUCIQDcs5OtQXK0845qsWp1NTYNDLz27IjUGwkUDAlu0bQN2AIgJzENK+Cs6BjXi0wurr/jozzb7U2gx0D1YVKbqq0sAP4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appitude%2fsendivent@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12320},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"2bfb227ab66302655742111df8ae015b2d0b81db","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f9363855-5fff-4e79-8437-5223dbd9a1c9"}},"repository":{"url":"git+https://github.com/appitudeio/sendivent-node.git","type":"git"},"_npmVersion":"11.7.0","description":"Official TypeScript/JavaScript SDK for Sendivent - Multi-channel notification platform","directories":{},"_nodeVersion":"20.19.6","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sendivent_0.2.1_1766653033727_0.5466799199067123","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@appitude/sendivent","version":"0.3.0","keywords":["sendivent","email","sms","slack","typescript"],"author":{"name":"Sendivent"},"license":"MIT","_id":"@appitude/sendivent@0.3.0","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"homepage":"https://github.com/appitudeio/sendivent-node#readme","bugs":{"url":"https://github.com/appitudeio/sendivent-node/issues"},"dist":{"shasum":"c97a8cf3910b1e52963e2d7189ac69675e76f066","tarball":"https://registry.npmjs.org/@appitude/sendivent/-/sendivent-0.3.0.tgz","fileCount":8,"integrity":"sha512-eZv1J9+vcX1/qkvQ13Rtyd25F68706ivG8kBHEM4zhuwsGfxLCeINv0Y/PqpYiCcyk3ZixzaIhBycdHidNPWOw==","signatures":[{"sig":"MEUCIQD65eRKd9venPj+1og5B2OhrhgY/mvzpLooegaqAYeLhQIgebv4QlHh7sFVUsIwmfqlQ7P3uaA2txyXCJC0D28Qoi8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appitude%2fsendivent@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11985},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"947e33f6f015b6b1dcbfa02a03383b95cf999182","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f9363855-5fff-4e79-8437-5223dbd9a1c9"}},"repository":{"url":"git+https://github.com/appitudeio/sendivent-node.git","type":"git"},"_npmVersion":"11.11.0","description":"Official TypeScript/JavaScript SDK for Sendivent - Multi-channel notification platform","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sendivent_0.3.0_1772887440514_0.7258200158443211","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@appitude/sendivent","version":"0.4.0","description":"Official TypeScript/JavaScript SDK for Sendivent - Multi-channel notification platform","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["sendivent","email","sms","slack","typescript"],"author":{"name":"Sendivent"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/appitudeio/sendivent-node.git"},"engines":{"node":">=18.0.0"},"devDependencies":{"typescript":"^5.0.0"},"publishConfig":{"access":"public"},"gitHead":"b6483014b87f0c07b846de7474e99682aab21322","_id":"@appitude/sendivent@0.4.0","bugs":{"url":"https://github.com/appitudeio/sendivent-node/issues"},"homepage":"https://github.com/appitudeio/sendivent-node#readme","_nodeVersion":"20.20.1","_npmVersion":"11.12.0","dist":{"integrity":"sha512-HCrTke8YOiFNP6HQfJ/aBunrFWN+TR27+nIjx5nClgK7t7qBe0ZghkFvomVF/VOcqKgzvNBwUQSYzql29LaiBg==","shasum":"81c8d80e30151d69f934198f99a39942c7cbc6d3","tarball":"https://registry.npmjs.org/@appitude/sendivent/-/sendivent-0.4.0.tgz","fileCount":10,"unpackedSize":17108,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appitude%2fsendivent@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB2KUfky6HiZirz2rNZTXIe3VL3IDjZfwgz6BSvvFR6lAiA/42fFnt39JpnF+CO19JkKJplbFGJ3GVnxB7Q6d/2PhA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f9363855-5fff-4e79-8437-5223dbd9a1c9"}},"directories":{},"maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sendivent_0.4.0_1774372113664_0.1989410437363084"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-17T09:31:28.803Z","modified":"2026-03-24T17:08:34.099Z","0.1.0":"2025-11-17T09:31:29.114Z","0.2.0":"2025-11-25T09:23:10.236Z","0.2.1":"2025-12-25T08:57:13.896Z","0.3.0":"2026-03-07T12:44:00.659Z","0.4.0":"2026-03-24T17:08:33.806Z"},"bugs":{"url":"https://github.com/appitudeio/sendivent-node/issues"},"author":{"name":"Sendivent"},"license":"MIT","homepage":"https://github.com/appitudeio/sendivent-node#readme","keywords":["sendivent","email","sms","slack","typescript"],"repository":{"type":"git","url":"git+https://github.com/appitudeio/sendivent-node.git"},"description":"Official TypeScript/JavaScript SDK for Sendivent - Multi-channel notification platform","maintainers":[{"name":"oakleaf","email":"mathiaseklof@gmail.com"}],"readme":"# Sendivent Node.js/TypeScript SDK\n\n[![npm version](https://img.shields.io/npm/v/@sendivent/sdk.svg)](https://www.npmjs.com/package/@sendivent/sdk)\n[![License](https://img.shields.io/npm/l/@sendivent/sdk.svg)](https://www.npmjs.com/package/@sendivent/sdk)\n\nOfficial TypeScript/JavaScript SDK for [Sendivent](https://sendivent.com) - Multi-channel notification platform supporting Email, SMS, Slack, and Push notifications.\n\n## Installation\n\n```bash\nnpm install @sendivent/sdk\n```\n\nRequires Node.js 18+ (for native `fetch` support)\n\n## Quick Start\n\n```typescript\nimport { Sendivent } from '@sendivent/sdk';\n\nconst sendivent = new Sendivent('test_your_api_key_here', 'welcome');\n\nawait sendivent\n  .to('user@example.com')\n  .payload({ name: 'John Doe' })\n  .send();\n```\n\nThe SDK automatically routes to sandbox (`test_*`) or production (`live_*`) based on your API key prefix.\n\n## Response Object\n\nThe `send()` method returns a `SendResponse` object with helper methods:\n\n```typescript\nconst response = await sendivent\n  .to('user@example.com')\n  .payload({ name: 'John' })\n  .send();\n\nif (response.isSuccess()) {\n  console.log('Sent! Queue IDs:', response.data);\n} else {\n  console.error('Error:', response.error);\n}\n\n// Available properties: success, data, error, message\n// Available methods: isSuccess(), hasError(), toObject(), toJson()\n```\n\n## Fire-and-Forget\n\nFor background sending without waiting for the response:\n\n```typescript\n// Fire and forget - returns immediately without waiting\nsendivent\n  .to('user@example.com')\n  .payload({ name: 'John' })\n  .send()\n  .catch(err => console.error('Background send failed:', err));\n\n// Continue with other work...\n```\n\n## Contact Objects & Smart Detection\n\nThe `to()` method accepts strings, Contact objects, or arrays of either. Sendivent automatically detects what type of identifier you're sending:\n\n```typescript\nimport type { Contact } from '@sendivent/sdk';\n\n// String inputs - automatically detected by pattern matching\nawait sendivent.event('welcome').to('user@example.com').send();  // Detected as email\nawait sendivent.event('sms-code').to('+1234567890').send();      // Detected as phone\nawait sendivent.event('alert').to('U12345').send();              // Detected as Slack user ID\n\n// Contact objects - your user's ID maps to external_id in Sendivent\nawait sendivent\n  .event('welcome')\n  .to({\n    id: 'user-12345',              // Your user's ID\n    email: 'user@example.com',\n    phone: '+1234567890',\n    name: 'John Doe',\n    avatar: 'https://example.com/avatar.jpg',\n    meta: { tier: 'premium' }\n  } as Contact)\n  .payload({ welcome_message: 'Hello!' })\n  .send();\n\n// Multiple recipients\nawait sendivent\n  .event('newsletter')\n  .to([\n    'user1@example.com',\n    { id: 'user-456', email: 'user2@example.com', name: 'Jane' }\n  ])\n  .payload({ subject: 'Newsletter' })\n  .send();\n\n// Broadcast to Slack channel (no contact created)\nawait sendivent\n  .event('system-alert')\n  .channel('slack')\n  .to('#general')  // Broadcasts to channel, doesn't create contact\n  .payload({ message: 'System update' })\n  .send();\n```\n\n## Key Features\n\n- **Multi-channel** - Email, SMS, Slack, and Push in one API\n- **Fluent API** - Clean, chainable method calls\n- **Type-safe** - Full TypeScript support with type definitions\n- **Fire-and-forget** - Non-blocking sends with promise-based API\n- **Idempotency** - Prevent duplicate sends with `idempotencyKey()`\n- **Template overrides** - Customize subject, sender, etc. per request\n- **Language support** - Send in different languages with `language()`\n- **Channel control** - Force specific channels with `channel()`\n- **Broadcast mode** - Send to event listeners without specifying recipients\n\n## Additional Examples\n\n### Channel-Specific Sending\n\n```typescript\nawait sendivent\n  .channel('sms')\n  .to('+1234567890')\n  .payload({ code: '123456' })\n  .send();\n```\n\n### Template Overrides\n\n```typescript\nawait sendivent\n  .to('user@example.com')\n  .payload({ amount: 100 })\n  .overrides({\n    email: {\n      subject: 'Custom Subject',\n      reply_to: 'billing@company.com'\n    }\n  })\n  .send();\n```\n\n### Brand Overrides\n\n```typescript\nawait sendivent\n  .to('user@example.com')\n  .overrides({\n    brand: { logotype: 'https://example.fi/logo.png' }\n  })\n  .send();\n```\n\n### Idempotency\n\n```typescript\nawait sendivent\n  .to('user@example.com')\n  .payload({ order_id: '12345' })\n  .idempotencyKey('order-12345-confirmation')\n  .send();\n```\n\n### Language Selection\n\n```typescript\nawait sendivent\n  .to('user@example.com')\n  .payload({ name: 'Anders' })\n  .language('sv')  // Swedish\n  .send();\n```\n\n### Broadcast Events\n\nSend to configured event listeners without specifying recipients:\n\n```typescript\nawait sendivent\n  .payload({ severity: 'high', message: 'System alert' })\n  .send();\n```\n\n## Full Example\n\nSee [example.ts](./example.ts) for a comprehensive demonstration of all SDK features.\n\n## TypeScript Support\n\nThe SDK is written in TypeScript and includes full type definitions:\n\n```typescript\nimport { Sendivent, Contact, SendResponse } from '@sendivent/sdk';\n\nconst contact: Contact = {\n  id: 'user-123',\n  email: 'user@example.com',\n  name: 'John Doe'\n};\n\nconst response: SendResponse = await sendivent\n  .to(contact)\n  .payload({ message: 'Hello' })\n  .send();\n```\n\n## Support\n\n- **Documentation:** [docs.sendivent.com](https://docs.sendivent.com)\n- **Issues:** [github.com/sendivent/sdk-node/issues](https://github.com/sendivent/sdk-node/issues)\n\n## License\n\nMIT License - see [LICENSE](./LICENSE) file for details.\n","readmeFilename":"README.md"}