mnotify-ts-sdk
Version:
Modern, zero-dependency TypeScript SDK for mNotify BMS API - Type-safe SMS, contacts, and account management with Railway-Oriented Programming
53 lines (52 loc) • 1.93 kB
TypeScript
import { type MNotifyConfig } from "./client/HttpClient";
import { SMSService } from "./sms/SMSService";
import { ContactService } from "./contacts/ContactService";
import { AccountService } from "./account/AccountService";
import { TemplateService } from "./templates/TemplateService";
import { GroupService } from "./groups/GroupService";
import { MNotifyError } from "./errors/MNotifyError";
/**
* Main MNotify SDK client
*
* @example
* ```typescript
* const mnotify = new MNotify({
* apiKey: process.env.MNOTIFY_API_KEY!
* });
*
* // Send SMS
* const response = await mnotify.sms.sendQuickBulkSMS({
* recipient: ['233200000000'],
* sender: 'MyApp',
* message: 'Hello!'
* });
*
* // Check balance
* const balance = await mnotify.account.getBalance();
*
* // Manage contacts
* const contact = await mnotify.contacts.createContact({
* phone: '233200000000',
* firstname: 'John',
* lastname: 'Doe'
* });
* ```
*/
export declare class MNotify {
readonly sms: SMSService;
readonly contacts: ContactService;
readonly account: AccountService;
readonly templates: TemplateService;
readonly groups: GroupService;
constructor(config: MNotifyConfig);
}
export { MNotifyError };
export type { MNotifyConfig } from "./client/HttpClient";
export type { SendSMSOptions, SendSMSResponse, SmsDeliveryReport, } from "./sms/SMSService";
export type { Contact, CreateContactInput } from "./contacts/ContactService";
export type { BalanceResponse, SenderId, SenderIdStatus, } from "./account/AccountService";
export type { Template, CreateTemplateInput, } from "./templates/TemplateService";
export type { Group, CreateGroupInput } from "./groups/GroupService";
export type { Result, Ok, Err } from "./types/Result";
export { ok, err, tryCatch, tryCatchAsync, combine } from "./types/Result";
export { toArray, normalizePhone, isValidPhone, chunk, compact, } from "./utils/helpers";