Skip to content

PURISTA API / Modules / @purista/infisical-secret-store

Module: @purista/infisical-secret-store

A secret store for using Infisical as storage.

For performance reasons, and to reduce costs, the secret values are cached in memory after first fetch.

You can disable the whole caching via config by setting enableCache to false.
If the cache is enabled, you can set the ttl for cached secret values via config cacheTtl (in ms).

This will return the cached secret if available and if ttl is not exceeded.
If a secret value exceeds the ttl, it does not automatically get removed from cache.
It will be removed/overwritten on next get request.

Example

typescript
const config = {
  bearerToken: 'YOUR_INFISICAL_TOKEN',
  baseUrl: 'https://app.infisical.com'
}

const store = new InfisicalSecretStore({ config })

await store.setSecret('mySecret', 'value')

let value = await store.getSecret('mySecret')
console.log(value) // outputs: { mySecret: 'value' }

await store.removeSecret('mySecret')

value = await store.getSecret('mySecret')
console.log(value) // outputs: undefined

Table of contents

Classes

Type Aliases

Variables

Type Aliases

ClientConfig

Ƭ ClientConfig: Prettify<Required<Pick<HttpClientConfig<HttpClientConfigCustom>, "bearerToken">> & Omit<HttpClientConfig<HttpClientConfigCustom>, "bearerToken">>

Defined in

infisical-secret-store/src/InfisicalClient/types/ClientConfig.ts:5


DecryptInput

Ƭ DecryptInput: Object

Type declaration

NameType
ciphertextstring
ivstring
secretstring
tagstring

Defined in

infisical-secret-store/src/InfisicalClient/types/DecryptInput.ts:1


EncryptInput

Ƭ EncryptInput: Object

Type declaration

NameType
secretstring
textstring

Defined in

infisical-secret-store/src/InfisicalClient/types/EncryptInput.ts:1


HttpClientConfigCustom

Ƭ HttpClientConfigCustom: Object

Defined in

infisical-secret-store/src/InfisicalClient/types/ClientConfig.ts:3


InfisicalSecretConfig

Ƭ InfisicalSecretConfig: ClientConfig

Defined in

infisical-secret-store/src/types.ts:3


Scope

Ƭ Scope: Object

Type declaration

NameType
_idstring
environmentstring
secretPathstring

Defined in

infisical-secret-store/src/InfisicalClient/types/Scope.ts:1


Secret

Ƭ Secret: Object

Type declaration

NameType
_idstring
createdAtstring
environmentstring
secretCommentCiphertext?string
secretCommentIV?string
secretCommentTag?string
secretKeyCiphertextstring
secretKeyIVstring
secretKeyTagstring
secretValueCiphertextstring
secretValueIVstring
secretValueTagstring
type"shared" | "personal"
updatedAtstring
user?string
versionnumber
workspacestring

Defined in

infisical-secret-store/src/InfisicalClient/types/Secret.ts:1


TokenData

Ƭ TokenData: Object

Type declaration

NameType
_idstring
createdAtstring
encryptedKeystring
expiresAtDate
ivstring
lastUsedDate
namestring
permissionsstring[]
scopesScope[]
serviceAccountstring
tagstring
updatedAtstring
user{ _id: string ; authMethods: string[] ; email: string ; firstName: string ; lastName: string }
user._idstring
user.authMethodsstring[]
user.emailstring
user.firstNamestring
user.lastNamestring
workspacestring

Defined in

infisical-secret-store/src/InfisicalClient/types/TokenData.ts:3

Variables

puristaVersion

Const puristaVersion: "1.11.0"

Defined in

infisical-secret-store/src/version.ts:1