Send a push notification with Thinwrap (TypeScript)

Send a push notification via the Thinwrap unified Push facade in TypeScript — same call shape for FCM, APNs, Expo, and every other supported push provider.

1. Install

npm install @thinwrap/notifications

2. Send the call

import { Push } from '@thinwrap/notifications';

// FCM uses RS256 JWT auth — pass the parsed service-account JSON
// (Thinwrap never reads files on your behalf).
const serviceAccount = JSON.parse(process.env.FCM_SERVICE_ACCOUNT_JSON!);

const push = new Push('fcm', {
  serviceAccount,
});

const result = await push.send({
  to: 'device-registration-token',
  title: 'New message',
  body: 'You have a new message waiting',
  data: { conversationId: '42' },
});

console.log(result.status, result.providerMessageId);

Same code works for all supported providers — just change the provider ID.