# gt-node: General Translation Node.js SDK: getVersionId
URL: https://generaltranslation.com/en-US/docs/node/reference/functions/get-version-id.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Read the configured translation version ID in General Translation gt-node. API reference for getVersionId.

Returns the translation version ID configured for the translation cache, if one is set. The version ID pins which published translation version `gt-node` loads.

## Overview [#overview]

Call `getVersionId` with no arguments to read the current version ID. It returns `undefined` when no version ID is configured.

```ts
import { getVersionId } from 'gt-node';

const versionId = getVersionId();
console.log(versionId); // 'abc123' or undefined
```

Signature:

```ts
getVersionId(): string | undefined
```

*Note: The version ID is an internal cache setting. `getVersionId` reads it back; it does not set it.*

## How it works [#how-it-works]

- **Reads cache config.** It returns the version ID held by the translation cache created during [`initializeGT`](/docs/node/reference/functions/initialize-gt).
- **Synchronous.** It returns immediately and does not need to be awaited.

## Parameters [#parameters]

`getVersionId` takes no parameters.

## Returns [#returns]

**Type** `string | undefined`

The configured version ID, or `undefined` when none is set.

## Examples [#examples]

```ts title="handler.js"
import { getVersionId } from 'gt-node';

app.get('/api/version', (req, res) => {
  res.json({ versionId: getVersionId() ?? null });
});
```

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
