Skip to content

mnotify-ts-sdk

Modules

ModuleDescription
<internal>-

Classes

ClassDescription
AccountAccount-related operations: balance and sender ID management.
ContactsContact management operations.
GroupsContact group management operations.
MNotifyMain SDK client for the mNotify API.
MNotifyErrorStructured error representing an mNotify API failure.
SMSSMS sending and campaign status operations.
TemplatesSMS template management operations.

Interfaces

InterfaceDescription
BalanceResponseResponse containing the account balance.
ContactA contact stored in the mNotify system.
CreateGroupInputInput type for creating a new group.
CreateTemplateInputInput type for creating a new template.
ErrA failed result containing an error.
GroupA contact group in the mNotify system.
MNotifyConfigConfiguration options for creating an MNotify client instance.
OkA successful result containing a value.
SenderIdStatusStatus of a registered sender ID.
SendSMSOptionsOptions for sending an SMS message.
SendSMSResponseResponse returned after sending an SMS campaign.
SmsDeliveryReportDelivery report for an SMS campaign.
TemplateAn SMS template in the mNotify system.

Type Aliases

Type AliasDescription
CreateContactInputInput type for creating a new contact. Omits the id field which is assigned by the server.
ResultRepresents the outcome of an operation that can succeed or fail.

Functions

FunctionDescription
chunkSplits an array into chunks of the specified size.
combineCombines 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.
compactRemoves null and undefined values from an object, returning a partial copy.
errCreates a failed Result containing the given error.
isValidPhoneReturns true if the phone number is between 10 and 15 digits after normalization.
normalizePhoneNormalizes a phone number by stripping non-digit characters and converting leading 0 to 233 country code.
okCreates a successful Result wrapping the given value.
toArrayWraps a value in an array if it is not already an array.
tryCatchWraps a synchronous function in try/catch, returning a Result. If the function throws, the error handler is called to produce the error value.
tryCatchAsyncWraps 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.