What's Changed
- feat!: RFC 8291 aes128gcm and RFC 8292 vapid by @maxholman in #19
Messages are now encrypted with aes128gcm (RFC 8291) and authenticated with the vapid scheme (RFC 8292), replacing the draft aesgcm encoding and the WebPush scheme. Apple accepts neither of the old ones, so Safari and iOS work now.
Verified against the RFC 8291 section 5 test vector, and by decrypting in Chrome and Firefox against their real push services.
Breaking
encryptNotificationreturns the RFC 8188 body instead of{ ciphertext, salt, localPublicKeyBytes }, and takes an options argument- the
crypto-keyandencryptionheaders are gone - messages are padded to a constant 4096 octets, so the maximum payload is 3993 bytes
- subscription endpoints must be
https,p256dhmust be a 65 byte uncompressed P-256 point andauth16 octets - node 22 or later
buildPushPayload is otherwise unchanged, so fetch(subscription.endpoint, payload) still works as documented. Stay on 1.x if you need the aesgcm encoding.
type-fest is no longer a dependency, leaving uint8array-extras as the only one.
Full Changelog: v1.0.2...v2.0.0