Classes · @purista/infisical-secret-store

InfisicalClient

HTTP client for the Infisical API used by `InfisicalSecretStore`.

Signature

InfisicalClient.ts typescript
class InfisicalClient

Constructors

1 entry

constructor

Constructor

Source
constructor.ts typescript
new constructor(conf: { baseUrl: string; basicAuth: { password: string; username: string }; bearerToken: string; defaultHeaders: Record<string, string>; defaultTimeout: number; enableOpentelemetry: boolean; ... })

Creates an Infisical API client.

Properties

8 entries

auth

Property

auth.ts typescript
auth: AuthCredentials

baseUrl

Property

baseUrl.ts typescript
baseUrl: URL | undefined

Parsed base URL, when configured.

config

Property

config.ts typescript
config: { baseUrl: string; basicAuth: { password: string; username: string }; bearerToken: string; defaultHeaders: Record<string, string>; defaultTimeout: number; enableOpentelemetry: boolean; ... }

Resolved client configuration.

logger

Property

logger.ts typescript
logger: Logger

Logger scoped to this client.

name

Property

name.ts typescript
name: string

Client name used in logs, spans, and metrics.

spanProcessor

Property

spanProcessor.ts typescript
spanProcessor: SpanProcessor | undefined

Optional OpenTelemetry span processor configured for this client.

timeout

Property

timeout.ts typescript
timeout: number

Default request timeout in milliseconds.

traceProvider

Property

traceProvider.ts typescript
traceProvider: NodeTracerProvider

Node tracer provider owned by this client instance.

Methods

14 entries

delete

Method

delete.ts typescript
delete<T>(path: string, options?: HttpClientRequestOptions, payload?: unknown): Promise<T>

DELETE request.

execute

Method

execute.ts typescript
execute(method: string, path: string, options?: HttpClientRequestOptions, payload?: unknown): Promise<any>

Helper method

get

Method

get.ts typescript
get<T>(path: string, options?: HttpClientRequestOptions): Promise<T>

GET request.

getSecret

Method

Source
getSecret.ts typescript
getSecret(name: string): Promise<string | undefined>

Reads and decrypts a single shared Infisical secret.

getServiceTokenData

Method

Source
getServiceTokenData.ts typescript
getServiceTokenData(): Promise<TokenData>

Fetches service-token metadata and decrypts the project key for later calls.

getTracer

Method

getTracer.ts typescript
getTracer(): Tracer

Returns OpenTelemetry tracer of this client.

getUrlAndHeader

Method

getUrlAndHeader.ts typescript
getUrlAndHeader(path: string, options?: HttpClientRequestOptions): { headers: Record<string, string>; url: URL }

patch

Method

patch.ts typescript
patch<T>(path: string, payload: unknown, options?: HttpClientRequestOptions): Promise<T>

PATCH request with an optional JSON payload.

post

Method

post.ts typescript
post<T>(path: string, payload: unknown, options?: HttpClientRequestOptions): Promise<T>

POST request with an optional JSON payload.

put

Method

put.ts typescript
put<T>(path: string, payload: unknown, options?: HttpClientRequestOptions): Promise<T>

PUT request with an optional JSON payload.

removeSecret

Method

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

Removes a shared Infisical secret from the token's first environment scope.

setBearerToken

Method

setBearerToken.ts typescript
setBearerToken(token: string | undefined): void

Set the bearer token for all following requests.

setSecret

Method

Source
setSecret.ts typescript
setSecret(name: string, value: string): Promise<void>

Creates or updates a shared Infisical secret.

startActiveSpan

Method

startActiveSpan.ts typescript
startActiveSpan<F>(name: string, opts: SpanOptions, context: Context | undefined, fn: (span: Span) => Promise<F>): Promise<F>

Start a child span for OpenTelemetry tracking.