mnotify-ts-sdk
Modules
| Module | Description |
|---|---|
| <internal> | - |
Classes
| Class | Description |
|---|---|
| Account | Account-related operations: balance and sender ID management. |
| Contacts | Contact management operations. |
| Groups | Contact group management operations. |
| MNotify | Main SDK client for the mNotify API. |
| MNotifyError | Structured error representing an mNotify API failure. |
| SMS | SMS sending and campaign status operations. |
| Templates | SMS template management operations. |
Interfaces
| Interface | Description |
|---|---|
| BalanceResponse | Response containing the account balance. |
| Contact | A contact stored in the mNotify system. |
| CreateGroupInput | Input type for creating a new group. |
| CreateTemplateInput | Input type for creating a new template. |
| Err | A failed result containing an error. |
| Group | A contact group in the mNotify system. |
| MNotifyConfig | Configuration options for creating an MNotify client instance. |
| Ok | A successful result containing a value. |
| SenderIdStatus | Status of a registered sender ID. |
| SendSMSOptions | Options for sending an SMS message. |
| SendSMSResponse | Response returned after sending an SMS campaign. |
| SmsDeliveryReport | Delivery report for an SMS campaign. |
| Template | An SMS template in the mNotify system. |
Type Aliases
| Type Alias | Description |
|---|---|
| CreateContactInput | Input type for creating a new contact. Omits the id field which is assigned by the server. |
| Result | Represents the outcome of an operation that can succeed or fail. |
Functions
| Function | Description |
|---|---|
| chunk | Splits an array into chunks of the specified size. |
| combine | Combines an array of Results into a single Result containing an array of values. Returns the first error encountered, or an array of all values if all Results are Ok. |
| compact | Removes null and undefined values from an object, returning a partial copy. |
| err | Creates a failed Result containing the given error. |
| isValidPhone | Returns true if the phone number is between 10 and 15 digits after normalization. |
| normalizePhone | Normalizes a phone number by stripping non-digit characters and converting leading 0 to 233 country code. |
| ok | Creates a successful Result wrapping the given value. |
| toArray | Wraps a value in an array if it is not already an array. |
| tryCatch | Wraps a synchronous function in try/catch, returning a Result. If the function throws, the error handler is called to produce the error value. |
| tryCatchAsync | Wraps an async function in try/catch, returning a Promise of a Result. If the function throws or rejects, the error handler is called to produce the error value. |