Classes · @purista/infisical-secret-store

InfisicalSecretStore

Secret store backed by Infisical.

Signature

InfisicalSecretStore.ts typescript
class InfisicalSecretStore

Examples

example-1.ts typescript
const store = new InfisicalSecretStore({
  bearerToken: process.env.INFISICAL_TOKEN ?? '',
  baseUrl: 'https:___PH0___
  cacheTtl: 30_000,
})

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

Constructors

1 entry

constructor

Constructor

Source
constructor.ts typescript
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

5 entries

cache

Property

cache.ts typescript
cache: SecretStoreCacheMap

Optional in-memory cache of secret values.

client

Property

Source
client.ts typescript
client: InfisicalClient

Infisical HTTP client used by this store.

config

Property

config.ts typescript
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

Property

logger.ts typescript
logger: Logger

Child logger scoped to the store name.

name

Property

name.ts typescript
name: string

Store name used in logs and diagnostics.

Methods

7 entries

destroy

Method

destroy.ts typescript
destroy(): Promise<void>

Shutdown hook for store adapters.

getSecret

Method

getSecret.ts typescript
getSecret<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>

Get one or more secrets by name.

getSecretImpl

Method

Source
getSecretImpl.ts typescript
getSecretImpl<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>

Adapter-specific secret lookup implementation.

removeSecret

Method

removeSecret.ts typescript
removeSecret(secretName: string): Promise<void>

Remove one secret by name.

removeSecretImpl

Method

Source
removeSecretImpl.ts typescript
removeSecretImpl(secretName: string): Promise<void>

Adapter-specific secret removal implementation.

setSecret

Method

setSecret.ts typescript
setSecret(secretName: string, secretValue: string): Promise<void>

Store or replace one secret value.

setSecretImpl

Method

Source
setSecretImpl.ts typescript
setSecretImpl(secretName: string, secretValue: string): Promise<void>

Adapter-specific secret write implementation.