@sendly/node
Advanced tools
+12
-9
@@ -758,15 +758,18 @@ /** | ||
| /** | ||
| * Test phone numbers for sandbox mode | ||
| * Test phone numbers for sandbox mode. | ||
| * Use these with test API keys (sk_test_*) to simulate different scenarios. | ||
| */ | ||
| declare const SANDBOX_TEST_NUMBERS: { | ||
| /** Always succeeds instantly */ | ||
| readonly SUCCESS: "+15550001234"; | ||
| /** Succeeds after 10 second delay */ | ||
| readonly DELAYED: "+15550001010"; | ||
| /** Always succeeds - any number not in error list succeeds */ | ||
| readonly SUCCESS: "+15005550000"; | ||
| /** Fails with invalid_number error */ | ||
| readonly INVALID: "+15550001001"; | ||
| /** Fails with carrier_rejected error after 2 seconds */ | ||
| readonly REJECTED: "+15550001002"; | ||
| readonly INVALID: "+15005550001"; | ||
| /** Fails with unroutable destination error */ | ||
| readonly UNROUTABLE: "+15005550002"; | ||
| /** Fails with queue_full error */ | ||
| readonly QUEUE_FULL: "+15005550003"; | ||
| /** Fails with rate_limit_exceeded error */ | ||
| readonly RATE_LIMITED: "+15550001003"; | ||
| readonly RATE_LIMITED: "+15005550004"; | ||
| /** Fails with carrier_violation error */ | ||
| readonly CARRIER_VIOLATION: "+15005550006"; | ||
| }; | ||
@@ -773,0 +776,0 @@ |
+12
-9
@@ -758,15 +758,18 @@ /** | ||
| /** | ||
| * Test phone numbers for sandbox mode | ||
| * Test phone numbers for sandbox mode. | ||
| * Use these with test API keys (sk_test_*) to simulate different scenarios. | ||
| */ | ||
| declare const SANDBOX_TEST_NUMBERS: { | ||
| /** Always succeeds instantly */ | ||
| readonly SUCCESS: "+15550001234"; | ||
| /** Succeeds after 10 second delay */ | ||
| readonly DELAYED: "+15550001010"; | ||
| /** Always succeeds - any number not in error list succeeds */ | ||
| readonly SUCCESS: "+15005550000"; | ||
| /** Fails with invalid_number error */ | ||
| readonly INVALID: "+15550001001"; | ||
| /** Fails with carrier_rejected error after 2 seconds */ | ||
| readonly REJECTED: "+15550001002"; | ||
| readonly INVALID: "+15005550001"; | ||
| /** Fails with unroutable destination error */ | ||
| readonly UNROUTABLE: "+15005550002"; | ||
| /** Fails with queue_full error */ | ||
| readonly QUEUE_FULL: "+15005550003"; | ||
| /** Fails with rate_limit_exceeded error */ | ||
| readonly RATE_LIMITED: "+15550001003"; | ||
| readonly RATE_LIMITED: "+15005550004"; | ||
| /** Fails with carrier_violation error */ | ||
| readonly CARRIER_VIOLATION: "+15005550006"; | ||
| }; | ||
@@ -773,0 +776,0 @@ |
+10
-8
@@ -444,12 +444,14 @@ "use strict"; | ||
| var SANDBOX_TEST_NUMBERS = { | ||
| /** Always succeeds instantly */ | ||
| SUCCESS: "+15550001234", | ||
| /** Succeeds after 10 second delay */ | ||
| DELAYED: "+15550001010", | ||
| /** Always succeeds - any number not in error list succeeds */ | ||
| SUCCESS: "+15005550000", | ||
| /** Fails with invalid_number error */ | ||
| INVALID: "+15550001001", | ||
| /** Fails with carrier_rejected error after 2 seconds */ | ||
| REJECTED: "+15550001002", | ||
| INVALID: "+15005550001", | ||
| /** Fails with unroutable destination error */ | ||
| UNROUTABLE: "+15005550002", | ||
| /** Fails with queue_full error */ | ||
| QUEUE_FULL: "+15005550003", | ||
| /** Fails with rate_limit_exceeded error */ | ||
| RATE_LIMITED: "+15550001003" | ||
| RATE_LIMITED: "+15005550004", | ||
| /** Fails with carrier_violation error */ | ||
| CARRIER_VIOLATION: "+15005550006" | ||
| }; | ||
@@ -456,0 +458,0 @@ |
+10
-8
@@ -384,12 +384,14 @@ // src/errors.ts | ||
| var SANDBOX_TEST_NUMBERS = { | ||
| /** Always succeeds instantly */ | ||
| SUCCESS: "+15550001234", | ||
| /** Succeeds after 10 second delay */ | ||
| DELAYED: "+15550001010", | ||
| /** Always succeeds - any number not in error list succeeds */ | ||
| SUCCESS: "+15005550000", | ||
| /** Fails with invalid_number error */ | ||
| INVALID: "+15550001001", | ||
| /** Fails with carrier_rejected error after 2 seconds */ | ||
| REJECTED: "+15550001002", | ||
| INVALID: "+15005550001", | ||
| /** Fails with unroutable destination error */ | ||
| UNROUTABLE: "+15005550002", | ||
| /** Fails with queue_full error */ | ||
| QUEUE_FULL: "+15005550003", | ||
| /** Fails with rate_limit_exceeded error */ | ||
| RATE_LIMITED: "+15550001003" | ||
| RATE_LIMITED: "+15005550004", | ||
| /** Fails with carrier_violation error */ | ||
| CARRIER_VIOLATION: "+15005550006" | ||
| }; | ||
@@ -396,0 +398,0 @@ |
+1
-1
| { | ||
| "name": "@sendly/node", | ||
| "version": "3.5.2", | ||
| "version": "3.5.3", | ||
| "description": "Official Sendly Node.js SDK for SMS messaging", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
+17
-9
@@ -80,8 +80,15 @@ # @sendly/node | ||
| // Basic usage | ||
| // Basic usage (marketing message - default) | ||
| const message = await sendly.messages.send({ | ||
| to: '+15551234567', | ||
| text: 'Your verification code is: 123456' | ||
| text: 'Check out our new features!' | ||
| }); | ||
| // Transactional message (bypasses quiet hours) | ||
| const message = await sendly.messages.send({ | ||
| to: '+15551234567', | ||
| text: 'Your verification code is: 123456', | ||
| messageType: 'transactional' | ||
| }); | ||
| // With custom sender ID (international) | ||
@@ -205,3 +212,3 @@ const message = await sendly.messages.send({ | ||
| await sendly.messages.send({ | ||
| to: SANDBOX_TEST_NUMBERS.SUCCESS, // +15550001234 - Always succeeds | ||
| to: SANDBOX_TEST_NUMBERS.SUCCESS, // +15005550000 - Always succeeds | ||
| text: 'Test message' | ||
@@ -211,3 +218,3 @@ }); | ||
| await sendly.messages.send({ | ||
| to: SANDBOX_TEST_NUMBERS.INVALID, // +15550001001 - Returns invalid_number error | ||
| to: SANDBOX_TEST_NUMBERS.INVALID, // +15005550001 - Returns invalid_number error | ||
| text: 'Test message' | ||
@@ -221,7 +228,8 @@ }); | ||
| |--------|----------| | ||
| | `+15550001234` | Instant success | | ||
| | `+15550001010` | Success after 10s delay | | ||
| | `+15550001001` | Fails: invalid_number | | ||
| | `+15550001002` | Fails: carrier_rejected (2s delay) | | ||
| | `+15550001003` | Fails: rate_limit_exceeded | | ||
| | `+15005550000` | Success (instant) | | ||
| | `+15005550001` | Fails: invalid_number | | ||
| | `+15005550002` | Fails: unroutable_destination | | ||
| | `+15005550003` | Fails: queue_full | | ||
| | `+15005550004` | Fails: rate_limit_exceeded | | ||
| | `+15005550006` | Fails: carrier_violation | | ||
@@ -228,0 +236,0 @@ ## Pricing Tiers |
208879
0.41%5316
0.13%338
2.42%