@pushharbor/expo
v0.2.1
Published
Pushharbor client for Expo / React Native: end-to-end encrypted Web Push through a Pushharbor relay
Maintainers
Readme
@pushharbor/expo
Expo / React Native client for Pushharbor: push notifications for self-hosted apps, end-to-end encrypted, sent by any Web Push library.
The module creates the device's Web Push keys, registers with your app's Pushharbor relay (proving it receives pushes there), and decrypts and shows notifications natively, even when the app is closed. Android is supported; iOS is planned with the same JavaScript API.
npx expo install @pushharbor/expoimport * as Pushharbor from '@pushharbor/expo';
await Pushharbor.requestNotificationPermission();
const subscription = await Pushharbor.register({
relayUrl: 'https://push.example.com', // your app's relay
senderKey: serverVapidPublicKey, // from the user's server
});
await api.post('/push/subscriptions', subscription); // { id, endpoint, expirationTime, keys }Requires Expo SDK 58+ with a development build (or a bare React Native app with Expo modules) and a Firebase project for your app.
MIT licensed.
