Generate the JWT for App Store Connect API.
import jwt from 'appstore-connect-jwt-generator-core';
import * as fs from 'fs';
const cert = fs.readFileSync('Path of certificate file', { flag: 'r' });
const token = jwt.tokenSync(cert, 'App Store Connect Issuer ID', 'App Store Connect Key ID');
npm i appstore-connect-jwt-token-generator-core
or
yarn add appstore-connect-jwt-token-generator-core
https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests