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

# Get a key by name

> Fetch a KMS key by its name with the Node.js SDK.

`client.kms().keys().getByName()` fetches a key in a [KMS](https://infisical.com/docs/documentation/platform/kms/overview.md) project by its name.

## Parameters

**options** `GetKmsKeyByNameOptions` *required*

**properties**

**projectId** `string` *required*

The ID of the KMS project.

**name** `string` *required*

The name of the key.

## Returns

**key** `KmsKey`

The key, with its `id`, which the other KMS methods take as `keyId`.

```typescript Basic theme={"dark"}
const key = await client.kms().keys().getByName({
  projectId: "<project-id>",
  name: "payments-data",
});
```

```json Response theme={"dark"}
{
  "id": "8c9d0e1f-2a3b-4c4d-9e5f-6a7b8c9d0e1f",
  "name": "payments-data",
  "description": "",
  "projectId": "5e8d7c6b-4a3f-4e2d-9c1b-0a9f8e7d6c5b",
  "orgId": "2c1b0a9f-8e7d-4c6b-5a4f-3e2d1c0b9a8f",
  "keyUsage": "encrypt-decrypt",
  "encryptionAlgorithm": "aes-256-gcm",
  "version": 1,
  "isDisabled": false,
  "createdAt": "2026-12-02T11:20:08.774Z",
  "updatedAt": "2026-12-02T11:20:08.774Z"
}
```


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