# InfisicalSecretStore API

Secret store backed by Infisical.

---
Canonical: /handbook/api/classes/_purista_infisical-secret-store.InfisicalSecretStore/
Source: infisical-secret-store/src/InfisicalSecretStore.impl.ts
Format: Markdown for agents
---

Secret store backed by Infisical.

Package: `@purista/infisical-secret-store`

## Signature

```typescript
class InfisicalSecretStore
```

## Examples

```typescript
const store = new InfisicalSecretStore({
  bearerToken: process.env.INFISICAL_TOKEN ?? '',
  baseUrl: 'https://app.infisical.com',
  cacheTtl: 30_000,
})

await store.setSecret('ACME_PROD_PAYMENTS_API_TOKEN', 'placeholder-secret')
const secret = await store.getSecret('ACME_PROD_PAYMENTS_API_TOKEN')
```

## Members

### Constructors

- `new constructor(config: { baseUrl: string; basicAuth: { password: string; username: string }; bearerToken: string; cacheTtl: number; defaultHeaders: Record<string, string>; defaultTimeout: number; ... })` — Creates an Infisical-backed secret store.

### Properties

- `cache: SecretStoreCacheMap` — Optional in-memory cache of secret values.
- `client: InfisicalClient` — Infisical HTTP client used by this store.
- `config: { baseUrl: string; basicAuth: { password: string; username: string }; bearerToken: string; cacheTtl: number; defaultHeaders: Record<string, string>; defaultTimeout: number; ... }` — Store configuration including operation toggles and cache settings.
- `logger: Logger` — Child logger scoped to the store name.
- `name: string` — Store name used in logs and diagnostics.

### Methods

- `destroy(): Promise<void>` — Shutdown hook for store adapters.
- `getSecret<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>` — Get one or more secrets by name.
- `getSecretImpl<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>` — Adapter-specific secret lookup implementation.
- `removeSecret(secretName: string): Promise<void>` — Remove one secret by name.
- `removeSecretImpl(secretName: string): Promise<void>` — Adapter-specific secret removal implementation.
- `setSecret(secretName: string, secretValue: string): Promise<void>` — Store or replace one secret value.
- `setSecretImpl(secretName: string, secretValue: string): Promise<void>` — Adapter-specific secret write implementation.
