Skip to content

Repository files navigation

Yournotify Node SDK

The official server SDK for engagement, Contacts, Lists, Automations, Rewards, Loyalty and Referrals.

Install

npm install yournotify-node-sdk

Quickstart

import Yournotify from "yournotify-node-sdk";

const yournotify = new Yournotify({
  apiKey: process.env.YOURNOTIFY_API_KEY,
});

await yournotify.email.send({ name: "Welcome", subject: "Welcome", from: "Feedcover", lists: [42] });
await yournotify.sms.send({ name: "OTP", from: "Feedcover", message: "Your code is 123456", lists: [42] });
await yournotify.whatsapp.send({ name: "Order update", from: "Feedcover", template_id: 12, lists: [42] });
await yournotify.voice.send({ name: "Delivery call", from: "Feedcover", message: "Your order is ready", lists: [42] });
await yournotify.push.send({ name: "New reward", title: "You earned a reward", body: "Tap to view", lists: [42] });
await yournotify.inapp.send({ name: "Referral prompt", title: "Refer a friend", body: "Share and earn", lists: [42] });

All public namespaces are lowercase, including inapp. Existing top-level methods remain available for compatibility.

Contacts, Lists and shared events

const list = await yournotify.lists.create({ name: "Feedcover customers" });
await yournotify.lists.update(list.data.id, { name: "Active Feedcover customers" });

await yournotify.identify({
  integration_id: "feedcover",
  external_id: "contact_123",
  email: "person@example.com",
  traits: { plan: "pro" },
});

await yournotify.track({
  integration_id: "feedcover",
  external_id: "contact_123",
  event: "order.completed",
  event_id: "feedcover_order_10042_completed",
  properties: { order_id: "10042", amount: 25000, currency: "NGN" },
  attribution: { referral_code: "ADA2026" },
});

const summary = await yournotify.contact.summary({ integration_id: "feedcover", external_id: "contact_123" });

One event can enroll Automations, award Loyalty points, qualify a Referral and issue a configured Reward. Always send a stable event_id or idempotency_key; safe retries will not duplicate processing.

Browser and mobile sessions

Permanent API keys are server-only. After identifying a Contact, create a short-lived scoped session on your server and pass only its token to the browser or mobile app:

const session = await yournotify.contact.createSession({
  integration_id: "feedcover",
  external_id: "contact_123",
  expires_in: 900,
});

Use @yournotify/react-native for React Native/Expo. Hosted reward claims remain available at https://web.yournotify.com/reward/{id}.

Reliability and webhooks

The SDK applies timeouts, safe retries with Retry-After, idempotency headers, request IDs and structured YournotifyApiError errors. Verify webhook signatures before processing them:

const valid = yournotify.webhooks.verify({
  payload: rawRequestBody,
  signature: request.headers["x-yournotify-signature"],
  secret: process.env.YOURNOTIFY_WEBHOOK_SECRET,
});

API documentation: https://web.yournotify.com/developer/docs

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages