Documentation
    Preparing search index...

    Message verifier is similar to the encryption. However, the actual payload is not encrypted and just base64 encoded. This is helpful when you are not concerned about the confidentiality of the data, but just want to make sure that is not tampered after encoding.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Sign a given piece of value using the app secret. A wide range of data types are supported.

      • String
      • Arrays
      • Objects
      • Booleans
      • Numbers
      • Dates

      You can optionally define a purpose for which the value was signed and mentioning a different purpose/no purpose during unsign will fail.

      Parameters

      • payload: any

        The data to be signed

      • OptionalexpiresIn: string | number

        Optional expiration time

      • Optionalpurpose: string

        Optional purpose for which the value is signed

      Returns string

      The signed payload as a string

    • Unsign a previously signed value with an optional purpose

      Type Parameters

      • T extends unknown

      Parameters

      • payload: string

        The signed payload string to verify

      • Optionalpurpose: string

        Optional purpose that the value was signed for

      Returns null | T

      The original data if valid, null if invalid or verification fails