Classes · @purista/infisical-secret-store
InfisicalSecretStore
Secret store backed by Infisical.
Signature
class InfisicalSecretStoreExamples
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_TOKEN39;)Constructors
1 entry
constructor
Constructor
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: SecretStoreCacheMapOptional in-memory cache of secret values.
client
Property
client: InfisicalClientInfisical HTTP client used by this store.
config
Property
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: LoggerChild logger scoped to the store name.
name
Property
name: stringStore name used in logs and diagnostics.
Methods
7 entries
destroy
Method
destroy(): Promise<void>Shutdown hook for store adapters.
getSecret
Method
getSecret<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>Get one or more secrets by name.
getSecretImpl
Method
getSecretImpl<SecretNames>(...secretNames: SecretNames): Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>Adapter-specific secret lookup implementation.
removeSecret
Method
removeSecret(secretName: string): Promise<void>Remove one secret by name.
removeSecretImpl
Method
removeSecretImpl(secretName: string): Promise<void>Adapter-specific secret removal implementation.
setSecret
Method
setSecret(secretName: string, secretValue: string): Promise<void>Store or replace one secret value.
setSecretImpl
Method
setSecretImpl(secretName: string, secretValue: string): Promise<void>Adapter-specific secret write implementation.