# encodeIdentityHeader

> Encode signed identity transaction bytes to base64 string for the X-Identity-Txn header.

```ts
import { encodeIdentityHeader } from 'x402-avm-js';
```

```ts
export function encodeIdentityHeader(signedBytes: Uint8Array): string;
```

Encode signed identity transaction bytes to base64 string for the X-Identity-Txn header.

Encodes the raw bytes of a signed identity transaction into a base64 string for transmission
in HTTP request headers (`X-Identity-Txn`).

## Parameters

- `signedBytes` (`Uint8Array`, required):
Signed transaction byte array.

## Returns

- `returns` (`string`):
Base64-encoded string representation.

## Example

```ts
const signedTxnBytes = account.signTransaction(identityTxn).blob;
const headerValue = encodeIdentityHeader(signedTxnBytes);
// Pass headerValue in 'X-Identity-Txn' header
```

Source: [src/index.ts](https://github.com/x402-avm/x402-avm-js/blob/main/src/index.ts#L827)

Source: https://x402-avm.github.io/reference/js/encode-identity-header
