{"_id":"@dotlab-hq/relayx-js","_rev":"3-fb5118735480d9cf295997424bd7eb74","name":"@dotlab-hq/relayx-js","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@dotlab-hq/relayx-js","version":"1.0.0","_id":"@dotlab-hq/relayx-js@1.0.0","maintainers":[{"name":"dotlabs-admin","email":"wpsadi+dotlabs@outlook.com"}],"homepage":"https://github.com/dotlab-hq/relayx-js#readme","bugs":{"url":"https://github.com/dotlab-hq/relayx-js/issues"},"dist":{"shasum":"5d853cf78153dc8870573962e98f70df13d1a544","tarball":"https://registry.npmjs.org/@dotlab-hq/relayx-js/-/relayx-js-1.0.0.tgz","fileCount":4,"integrity":"sha512-316+aN3UrFC2B/rSzhrJlLymEBABMznnJpfE3rcFhDdTGkkjnJzsaDofBoqbDF/q062w2oBdHLkrIz8yxkT5ZQ==","signatures":[{"sig":"MEUCIQDhC7dmXo2WJDv9FoQ0jpABrOXkkSXU8DcQ33zPlk6tfAIgEMA1vo+qlCqSeeitoxzBqKqxINgopK+e8j5hhbW26o4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dotlab-hq%2frelayx-js@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":6302},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7379536214db431eaf3f3a3217bbeccf972203e2","scripts":{"dev":"tsx src/index.ts","build":"tsup src/index.ts --format esm --platform node --target node20 --out-dir dist --clean --dts","typecheck":"tsc --noEmit","prepublishOnly":"npm run typecheck && npm run build"},"_npmUser":{"name":"dotlabs-admin","email":"wpsadi+dotlabs@outlook.com"},"repository":{"url":"git+https://github.com/dotlab-hq/relayx-js.git"},"_npmVersion":"10.8.2","description":"Official JavaScript/TypeScript SDK for the RelayX SMS API","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.5.0","typescript":"^5.9.2","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/relayx-js_1.0.0_1773126974453_0.34572502348937606","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dotlab-hq/relayx-js","version":"1.0.1","_id":"@dotlab-hq/relayx-js@1.0.1","maintainers":[{"name":"dotlabs-admin","email":"wpsadi+dotlabs@outlook.com"}],"homepage":"https://github.com/dotlab-hq/relayx-js#readme","bugs":{"url":"https://github.com/dotlab-hq/relayx-js/issues"},"dist":{"shasum":"397553535134e554ed368dc874fa0408eecfcbfa","tarball":"https://registry.npmjs.org/@dotlab-hq/relayx-js/-/relayx-js-1.0.1.tgz","fileCount":4,"integrity":"sha512-mGJWreqSGzKRWeHMPlvHprBOWhi1rjOhcga0sqCW70K3AmjBLm2MBM170G6qssTmBzxXMLeKrzREQvAlDTzj3g==","signatures":[{"sig":"MEUCIF0jhg9koENb3Y67VZZJe4HM7lYqVzOAFwanYXOe7BvhAiEAxjOMAqE+iqSVW4zMjXFvvJ+lb4bJhGRNj5l2y5kvNGE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dotlab-hq%2frelayx-js@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":6302},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6f12376a751468bf93ca1b90b29ad434a229ac36","scripts":{"dev":"tsx src/index.ts","build":"tsup src/index.ts --format esm --platform node --target node20 --out-dir dist --clean --dts","typecheck":"tsc --noEmit","prepublishOnly":"npm run typecheck && npm run build"},"_npmUser":{"name":"dotlabs-admin","email":"wpsadi+dotlabs@outlook.com"},"repository":{"url":"git+https://github.com/dotlab-hq/relayx-js.git"},"_npmVersion":"10.8.2","description":"Official JavaScript/TypeScript SDK for the RelayX SMS API","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.5.0","typescript":"^5.9.2","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/relayx-js_1.0.1_1773127090545_0.00034831199195450857","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dotlab-hq/relayx-js","version":"1.0.2","description":"Official JavaScript/TypeScript SDK for the RelayX SMS API","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"publishConfig":{"access":"public"},"repository":{"url":"git+https://github.com/dotlab-hq/relayx-js.git"},"engines":{"node":">=20.0.0"},"scripts":{"dev":"tsx src/index.ts","build":"tsup src/index.ts --format esm --platform node --target node20 --out-dir dist --clean --dts","typecheck":"tsc --noEmit","prepublishOnly":"npm run typecheck && npm run build"},"devDependencies":{"@types/node":"^24.0.0","tsup":"^8.5.0","tsx":"^4.7.0","typescript":"^5.9.2"},"_id":"@dotlab-hq/relayx-js@1.0.2","gitHead":"ea9cdfb414fd2ad96a5566ce8a4cec963c057a91","bugs":{"url":"https://github.com/dotlab-hq/relayx-js/issues"},"homepage":"https://github.com/dotlab-hq/relayx-js#readme","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-VQpaftye4HVjQfBNOl/DIh6KQXwq3g3eURPNbtRGuEmfvVDTn58f54CpmgEPMGc3T09cGeWwrBBD636V/a58ZA==","shasum":"caafe5b8697597de2383277dd91aec8c3ebc5f46","tarball":"https://registry.npmjs.org/@dotlab-hq/relayx-js/-/relayx-js-1.0.2.tgz","fileCount":4,"unpackedSize":6370,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dotlab-hq%2frelayx-js@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCWUV4AP7WUdm+rZmsTi11KPL29LiWaJgS18lHec4qyEAIgCgL9OkEq2rmrBiw67lH3vK78dICFxXQh4YQKDSzMXOw="}]},"_npmUser":{"name":"dotlabs-admin","email":"wpsadi+dotlabs@outlook.com"},"directories":{},"maintainers":[{"name":"dotlabs-admin","email":"wpsadi+dotlabs@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/relayx-js_1.0.2_1773128853993_0.7157587225868922"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-10T07:16:14.332Z","modified":"2026-03-10T07:47:34.414Z","1.0.0":"2026-03-10T07:16:14.630Z","1.0.1":"2026-03-10T07:18:10.700Z","1.0.2":"2026-03-10T07:47:34.125Z"},"bugs":{"url":"https://github.com/dotlab-hq/relayx-js/issues"},"homepage":"https://github.com/dotlab-hq/relayx-js#readme","repository":{"url":"git+https://github.com/dotlab-hq/relayx-js.git"},"description":"Official JavaScript/TypeScript SDK for the RelayX SMS API","maintainers":[{"name":"dotlabs-admin","email":"wpsadi+dotlabs@outlook.com"}],"readme":"# @dotlab-hq/relayx-js\n\nOfficial JavaScript / TypeScript SDK for the [RelayX](https://relayx.wpsadi.dev) SMS API.\n\n## Installation\n\n```bash\n# npm\nnpm install @dotlab-hq/relayx-js\n\n# yarn\nyarn add @dotlab-hq/relayx-js\n\n# pnpm\npnpm add @dotlab-hq/relayx-js\n\n# bun\nbun add @dotlab-hq/relayx-js\n```\n\n## Quick start\n\n```ts\nimport RelayX from \"@dotlab-hq/relayx-js\";\n\nconst relayx = new RelayX(\"your-api-key\");\n\nconst result = await relayx.sendSMS({\n  number: \"+14155552671\", // with country code\n  message: \"Hello from RelayX!\",\n});\n\nconsole.log(result);\n```\n\n## Configuration\n\n### `new RelayX(apiKey?, options?)`\n\n| Parameter | Type | Default | Description |\n|---|---|---|---|\n| `apiKey` | `string` | `process.env.RELAYX_API_KEY` | Your RelayX API key. If omitted the SDK reads `RELAYX_API_KEY` from the environment. |\n| `options.endpoint` | `string` | `https://relayx.wpsadi.dev/api/send-sms` | Override the API endpoint (useful for self-hosted deployments or testing). |\n\n### API key from environment\n\nSet `RELAYX_API_KEY` in your environment and omit the first argument:\n\n```ts\n// process.env.RELAYX_API_KEY is read automatically\nconst relayx = new RelayX();\n```\n\n### Custom endpoint\n\n```ts\nconst relayx = new RelayX(\"your-api-key\", {\n  endpoint: \"https://my-proxy.example.com/send-sms\",\n});\n```\n\n## Methods\n\n### `relayx.sendSMS(params)`\n\nSend an SMS message.\n\n**Parameters**\n\n| Field | Type | Description |\n|---|---|---|\n| `number` | `string` | Recipient phone number **including the country code** (e.g. `\"+14155552671\"`). |\n| `message` | `string` | The text body of the SMS. |\n\n**Returns** `Promise<SendSMSResponse>`\n\n```ts\ninterface SendSMSResponse {\n  success: boolean;\n  message?: string;\n  [key: string]: unknown;\n}\n```\n\n**Example**\n\n```ts\nconst response = await relayx.sendSMS({\n  number: \"+14155552671\",\n  message: \"Your verification code is 123456\",\n});\n\nif (response.success) {\n  console.log(\"SMS sent!\");\n}\n```\n\n**Errors**\n\nThe method throws an `Error` for:\n\n- Missing or empty `number` / `message`.\n- Non-2xx HTTP responses from the API (the status code and response body are included in the error message).\n- Network-level failures.\n\n## TypeScript\n\nThe package ships its own `.d.ts` declarations — no additional `@types` package needed.\n\n```ts\nimport RelayX, { type SendSMSParams, type SendSMSResponse } from \"@dotlab-hq/relayx-js\";\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}