Skip to content

Commit

Permalink
feat: add documentation on what the various keys are used for
Browse files Browse the repository at this point in the history
  • Loading branch information
karrui committed Feb 22, 2021
1 parent 2f3e852 commit 9b6b243
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import Crypto from './crypto'
*/
export = function (config: PackageInitParams = {}) {
const { webhookSecretKey, mode, verificationOptions } = config
/**
* Public key is used for decrypting signed verified content in the `crypto` module, and
* also for verifying webhook signatures' authenticity in the `wehbooks` module.
*/
const signingPublicKey = getSigningPublicKey(mode || 'production')
/**
* Public key is used for verifying verified field signatures' authenticity in the `verification` module.
*/
const verificationPublicKey = getVerificationPublicKey(mode || 'production')

return {
Expand Down

0 comments on commit 9b6b243

Please sign in to comment.