# JWT Sign

Signs a JSON object as a JSON Web Token using a provided secret / private key. The key should be either the secret for HMAC algorithms or the PEM-encoded private key for RSA and ECDSA. JWT Sign lives in the **Cryptography** category of the `fx` menu. See [JSON Web Token (JWT)](https://datatracker.ietf.org/doc/html/rfc7519) for format details.

## Parameters

| Parameter          | Type   | Required | Default  | Description                                                                      |
| ------------------ | ------ | -------- | -------- | -------------------------------------------------------------------------------- |
| Input              | string | yes      | —        | Value to transform. Previous step output or a literal.                           |
| Private/Secret Key | string | no       | `secret` | Argument value for this operation.                                               |
| Signing algorithm  | string | no       | `HS256`  | Choose one of: `HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, and 4 more. |

`Input` is the primary value (previous step output or a literal).

## Returned value

| Type     | Description                            |
| -------- | -------------------------------------- |
| `string` | Result of the JWT Sign transformation. |

## Limitations

- Wrong key, algorithm options, or malformed input typically raises an evaluation error — fix Input or options before re-running.

## Example

<details>
<summary>Run JWT Sign</summary>

Signs a JSON object as a JSON Web Token using a provided secret / private key. Adjust optional parameters when the defaults do not match your payload.

1. Set **Input** to the value to transform (previous step output or a literal).

2. Review **Private/Secret Key**, **Signing algorithm** and keep defaults unless your format requires otherwise.

3. Confirm **Output value** shows the transformed result.

</details>
