> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# util.jwtSign()

> Public low-code contract, signatures and examples for util.jwtSign.

## `util.jwtSign()`

Signs a JWT.

### Signature

```ts theme={null}
static jwtSign(
      payload: string | object,
      secret: string | { key: string; passphrase: string },
      options?: {
        algorithm?:
          | 'HS256'
          | 'HS384'
          | 'HS512'
          | 'RS256'
          | 'RS384'
          | 'RS512'
          | 'ES256'
          | 'ES384'
          | 'ES512'
          | 'PS256'
          | 'PS384'
          | 'PS512'
          | 'none';
        keyid?: string;
        expiresIn?: string | number;
        notBefore?: string | number;
        audience?: string | string[];
        subject?: string;
        issuer?: string;
        jwtid?: string;
        mutatePayload?: boolean;
        noTimestamp?: boolean;
        header?: JWTHeader;
        encoding?: string;
        allowInsecureKeySizes?: boolean;
        allowInvalidAsymmetricKeyTypes?: boolean;
      },
    ): string;
```

### Example

```ts theme={null}
const token = util.jwtSign(
  { sub: 'c-1' },
  secret,
  { expiresIn: '1h' },
);
```

See [all util methods](https://docs.revoengine.com/low-code/reference/util.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.