Loading
Code Deb

Code Deb Notify

Validate Nepal mobile numbers and estimate GSM-7/UCS-2 multipart SMS. Render bilingual message templates with escaped HTML variables. TypeScript examples, API reference and installation guidance.

Technical documentation for 27 Code Deb JavaScript and TypeScript SDKs, Verify and MCP APIs and the developer platform. Browse API references, authentic implementation examples and provider boundaries. Check actual npm availability before installing.

Code Deb Notify is a typed, provider-agnostic notification SDK for Nepal-focused web, mobile, POS, ERP, booking and SaaS applications. It prepares SMS, email, WhatsApp and push messages, validates recipients, renders bilingual Nepali/English templates and normalizes delivery events. Your application supplies its own provider accounts, credentials, adapters, recipient consent and database. The SDK never accesses Code Deb client records or private messaging infrastructure.

Package: @codedeb/notify · Version: 0.1.0 source candidate · npm: not published/verified. Public staging is guarded; do not run npm install until the exact package version and tarball are verified.

What is included for developers?

CapabilityIncluded in SDKNeeds your integration
SMSNepal +977 recipient validation, Unicode, segment estimates, transport interfaceSMS gateway account, sender ID, credits, webhooks
EmailSubject/text payload, localized templates, escaped interpolationSMTP or email service, SPF/DKIM/DMARC, bounces and suppression
WhatsAppValidated message intent, explicit opt-in, approved template referenceMeta WhatsApp Business Platform or BSP, account approval, billing, webhooks
Mobile pushBounded token shape, notification envelope and adapterFCM/APNs credentials, device registration and token rotation
DeliveryAccepted/sent receipt, status normalization, idempotency contractReal provider delivery callbacks, signature checks and persistent storage
TemplatesStrict placeholders, Nepali Unicode, locale fallback, HTML-safe variablesPersistent template administration, governance and approvals

This division keeps the reusable developer toolkit useful without distributing Code Deb's internal gateway configuration, infrastructure, commercial automations or private customer information.

Implementation workflow

  1. Choose SMS, email, push or WhatsApp and validate the intended recipient using a channel-specific address.
  2. Select an English/Nepali template, bind validated variables and record actual marketing or WhatsApp consent where applicable.
  3. Connect a licensed provider from your own trusted backend using a typed adapter and claim a durable idempotency key before any billable send.
  4. Store the provider's real acceptance receipt; reconcile authentic, signature-verified provider webhooks before marking a message delivered or deciding to retry.

1. Create a bilingual template

import {renderNotifyTemplate,selectNotifyTemplate} from '@codedeb/notify';

const templates=[
 {id:'ticket-ready',locale:'ne-NP',body:'नमस्ते {{name}}, तपाईंको टिकट {{ticket}} तयार छ।'},
 {id:'ticket-ready',locale:'en-NP',body:'Hello {{name}}, your ticket {{ticket}} is ready.'},
];
const template=selectNotifyTemplate(templates,'ticket-ready','ne-NP','en-NP');
const message=renderNotifyTemplate(template,{name:'सीता',ticket:'MT-1234'});
console.log(message.body);

Unknown placeholders are rejected rather than silently stripped. HTML template interpolations escape characters including angle brackets and quotes; do not bypass your provider's own content policy. This supports Unicode text, not automatic transliteration or Nepali calendar conversion.

2. Estimate SMS encoding and segments

import {estimateSmsSegments,normalizeNepalRecipient} from '@codedeb/notify';

console.log(normalizeNepalRecipient('९८०१२३४५६७')); // +9779801234567
console.log(estimateSmsSegments('तपाईंको टिकट तयार छ'));

For standard single-part payloads, GSM-7 allows up to 160 septets and UCS-2 up to 70 UTF-16 units. Multipart limits commonly reduce to 153 and 67 respectively. Extended GSM characters take two septets. Segmentation is only an estimate: provider encoding, national numbering policy and carrier pricing can differ. The SDK does not calculate SMS delivery cost or verify a subscriber's identity.

3. Connect your own email or SMS provider

import {createNotifier} from '@codedeb/notify';

// These adapters are implemented by your own trusted backend.
const smsAdapter={
 channel:'sms' as const,
 send:async message=>mySmsProvider.send({
   to:message.to,text:message.body,idempotencyKey:message.idempotencyKey
 })
};
const notifications=createNotifier({
 adapters:[smsAdapter],
 idempotencyStore:{claim:async(key,ttlSeconds)=>database.claimOnce(key,ttlSeconds)}
});
const receipt=await notifications.send({
 idempotencyKey:'ticket-2083-00001',
 purpose:'transactional',
 recipient:{channel:'sms',address:'९८०१२३४५६७'},
 body:'तपाईंको टिकट तयार छ'
});
console.log(receipt.state); // accepted or sent, not guaranteed delivered

The mySmsProvider and database placeholders are application code, not Code Deb provider connectors. The provider adapter must return a real provider message ID, accepted/sent state and ISO timestamp. A database-level atomic claim is required to protect against duplicate paid sends and retries across server replicas. Reconciliation of ambiguous sends happens in the integrating backend.

4. WhatsApp and opt-in

For business-initiated WhatsApp automation, use a customer-owned Meta/BSP account, verify relevant customer opt-in and supply an appropriate approved template reference. The SDK deliberately requires a template reference and recorded consent evidence for this safe initial API. Your WhatsApp provider determines actual approved template state, service windows, permissible message category, pricing and delivery receipts.

import {prepareNotification} from '@codedeb/notify';

const outbound=prepareNotification({
 idempotencyKey:'order-2083-00002',purpose:'transactional',
 recipient:{channel:'whatsapp',address:'+9779801234567'},
 consent:{grantedAt:'2026-11-25T00:00:00.000Z',source:'checkout opt-in'},
 providerTemplateId:'order_update',
 body:'Your order is being prepared.'
});

A local format check never confers user consent. See Meta WhatsApp Business Platform for sender, template and API setup. Templates may require review or provider-specific exceptions; the provider enforces these, not the SDK.

5. Push delivery, status events and retries

The push adapter expects your own push-token records and service-account authorization. Use the provider's delivery reporting as an independent source of truth, then normalize received events after signature verification. Accepted, sent, delivered, failed and unknown are separate states; acceptance is never automatically upgraded to delivered.

import {normalizeNotificationStatus,notifyRetryDelay} from '@codedeb/notify';

const status=normalizeNotificationStatus({
 providerMessageId:'provider-123',
 state:'delivered',
 occurredAt:'2026-11-25T00:00:00.000Z'
});
console.log(status.state,notifyRetryDelay(3));

Do not blindly retry unknown-status notifications: an upstream timeout may have occurred after a provider accepted the message. A durable queue and reconciling provider status API are external integrations. For authorized push-server setup, follow Firebase Cloud Messaging HTTP v1.

Free developer SDK versus paid Code Deb services

SDK source candidate (intended public Apache-2.0 distribution): Typed payloads, channel validation, reusable adapters, Unicode/SMS segmentation, template rendering, opt-in evidence structures, idempotency interfaces and normalized status records.

Code Deb managed services (scope/pricing by proposal): Provider account selection and onboarding, approved SMS gateways, verified WhatsApp Business setup, SMTP/ESP provisioning, high-volume queues, retries and suppression, delivery analytics and dashboard, compliance and template review, sender reputation and deliverability monitoring, uptime/SLA work, and tenant-specific authentication and integrations.

Code Deb does not supply free SMS credits, email inbox capacity, WhatsApp numbers or push credentials with the SDK. Developers can build their own working transport adapters without buying Code Deb services.

Frequently asked questions

1. What is Code Deb Notify?

It is a standalone TypeScript/JavaScript notification SDK that validates and prepares messages across SMS, email, WhatsApp and push. It is not itself an SMS carrier, bulk messaging service or hosted inbox.

2. Does Code Deb provide SMS or WhatsApp credits?

No. Users connect their own licensed gateway, Meta WhatsApp Business Platform account or authorized messaging provider. Provider usage charges are independent.

3. Can I send Nepali Unicode SMS?

Yes. Nepali text is supported in templates and SMS estimates. Providers and networks determine actual segmentation, billing and delivery. Nepali SMS generally uses UCS-2 instead of GSM-7.

4. Does the SDK work with Brevo, Resend, SMTP, Twilio or a Nepali SMS gateway?

It can work through an adapter you implement against the provider's supported APIs. No production-ready transport implementation or implicit authorization for these providers is bundled in the initial SDK.

5. Is WhatsApp messaging automatic after installation?

No. An approved Meta/BSP sender, opt-in, relevant templates and authorized API credentials are needed. The SDK prepares data; your backend submits messages to the approved provider.

6. Can it send Firebase push notifications?

It defines a push adapter and validates token-shaped input. A Firebase project, authorized FCM HTTP v1 sender, device registration and token management still must be configured externally.

7. Are messages automatically retried?

No. The SDK provides deterministic retry-delay math and an atomic idempotency-store contract. Persistent queues, concurrency, monitoring and provider reconciliation are the application's responsibility or a separately contracted Code Deb service.

8. Does an accepted receipt mean delivery succeeded?

No. Accepted or sent indicates that a provider took or submitted the request. Delivery and failure statuses must come from verified delivery events or provider status queries.

9. What is free, and what is a paid service?

The planned public package contains portable notification logic. Code Deb separately offers setup, hosted integrations, delivery orchestration, monitoring and maintenance; pricing is based on the deployment and providers.

10. Does the SDK expose Code Deb's infrastructure or business data?

No. The package is standalone and intentionally contains no customer records, private API credentials, internal templates, production gateways, Code Deb billing logic or proprietary managed-service backends.

Troubleshooting

SMS shows more segments than expected: Nepali Unicode generally uses UCS-2. Count UTF-16 units, not visible characters, and check your provider's actual encoding and tariffs.

WhatsApp template rejected: Use an authorized business sender and a genuinely approved template ID; the SDK does not obtain Meta approvals or grant opt-in.

Duplicate notification blocked: Reconcile the prior provider acceptance/status and the atomic idempotency record. Do not bypass the key after a timeout; a paid send may already have succeeded.

Email HTML rejected: Use escaped template variables, a valid email subject, and your provider's allowed HTML policy. Configure SPF/DKIM/DMARC independently.

npm returns 404: This is still an unpublished source candidate. Do not install a nonexistent release; verify the exact version with the command below.

Test and release verification

npm run test:nepal-sdks
npm run sdk:pack:test
npm run sdk:pack:verify
node scripts/sdk/check-npm-publication.mjs --sdk=sdk-notify
npm view @codedeb/notify@0.1.0 version

The SDK source package remains private and UNLICENSED; the guarded standalone staging process will apply the reviewed Code Deb Apache-2.0 distribution license. Do not advertise npm installation before the exact @codedeb/notify@0.1.0 registry metadata, latest tag and public tarball are independently verified. No government, Meta or telecom certification is implied.

Resources and next steps

More from Code Deb

Read about our agency, explore available services, or contact the team for a project discussion.