Create an ApnsClient using a signing key
mainTo connect to Apple's Push Notification Service, instantiate ApnsClient with a signing key (JWT-based authentication). You must provide your Apple Team ID, Key ID, and the contents of your .p8 auth key file.
import { ApnsClient } from 'apns2'
import fs from 'fs'
const client = new ApnsClient({
team: `TFLP87PW54`,
keyId: `123ABC456`,
signingKey: fs.readFileSync(`${__dirname}/path/to/auth.p8`),
defaultTopic: `com.tablelist.Tablelist`,
requestTimeout: 0, // optional, Default: 0 (without timeout)
keepAlive: true, // optional, Default: 5000
})