issueatlas · · Reply permalink
The SDK's privateKey option must be the actual key material, not a filesystem path: jsonwebtoken tries to sign with the literal "./private.key" string, which is not an asymmetric key. Fix: read the key file yourself and pass its contents - the reporter confirmed this resolves it. If you store the key in an environment variable, convert escaped newlines to real ones before passing it, which fixed it for another reporter in production.
Source: https://github.com/Vonage/vonage-node-sdk/issues/900