---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/mrt](../index.md) / createLoggingToken

# Function: createLoggingToken()

> **createLoggingToken**(`options`, `auth`): `Promise`\<`string`\>

Defined in: [packages/b2c-tooling-sdk/src/operations/mrt/tail-logs.ts:97](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/e7c16f1ae423da0aa47b3e10be88f9770b53619b/packages/b2c-tooling-sdk/src/operations/mrt/tail-logs.ts#L97)

Creates a logging JWT token for WebSocket authentication.

POST /api/projects/{project}/target/{environment}/jwt/

## Parameters

### options

[`CreateLoggingTokenOptions`](../interfaces/CreateLoggingTokenOptions.md)

Token creation options

### auth

[`AuthStrategy`](../../../auth/interfaces/AuthStrategy.md)

Authentication strategy (ApiKeyStrategy)

## Returns

`Promise`\<`string`\>

The JWT token string

## Throws

Error if token creation fails
