Skip to main content
Runtime modules are the built-in capabilities you call from automations on the foundation, and the crypto module is one of them. It provides cryptographic helpers built on Node’s crypto, with no external dependencies. Typical uses: OAuth PKCE, webhook signature verification (HMAC), signed JWT client assertions, and content fingerprints.

sha256 / sha512 / md5

Compute a cryptographic digest of a string.
Returns the digest as a string. sha512 and md5 take the same parameters (md5 for legacy/etag use only).

hmac

Compute a keyed HMAC signature, used to sign or verify webhooks.
Returns the signature as a string.

base64Encode / base64Decode

Encode or decode base64, with an optional URL-safe variant.
base64Encode returns the encoded string; base64Decode returns the decoded UTF-8 string.

randomBytes

Generate cryptographically-secure random bytes, e.g. a PKCE code_verifier or a token.
Returns the random value as a string.

randomUUID

Generate a canonical random UUID v4 (with dashes).
Takes no parameters. For a dash-free UUID inline in an expression, the uuid() helper is also available.

signJwt

Sign a JWT with a private key you supply, for example an OAuth client_assertion (RFC 7523) for certificate-based client authentication.
RSA keys must be 2048 to 4096 bits. When key also contains certificates (in any order, a CA certificate included), the one whose public key matches the private key is used: it must be within its validity period, and its SHA-256 thumbprint is added to the header as x5t#S256. Certificates are only parsed — no chain or trust verification. Returns { jwt } on success. On any input problem it returns { error } instead of failing the instruction, with one of these codes:
Pass the private key into the calling automation through an argument declared with secret: true, so its value is masked in runtime events (see Protecting sensitive fields). The result never contains the key.

OAuth PKCE example

The two crypto primitives PKCE needs, end to end: