Classes · @purista/infisical-secret-store
InfisicalClient
HTTP client for the Infisical API used by `InfisicalSecretStore`.
Signature
class InfisicalClientConstructors
1 entry
constructor
Constructor
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: AuthCredentialsbaseUrl
Property
baseUrl: URL | undefinedParsed base URL, when configured.
config
Property
config: { baseUrl: string; basicAuth: { password: string; username: string }; bearerToken: string; defaultHeaders: Record<string, string>; defaultTimeout: number; enableOpentelemetry: boolean; ... }Resolved client configuration.
logger
Property
logger: LoggerLogger scoped to this client.
name
Property
name: stringClient name used in logs, spans, and metrics.
spanProcessor
Property
spanProcessor: SpanProcessor | undefinedOptional OpenTelemetry span processor configured for this client.
timeout
Property
timeout: numberDefault request timeout in milliseconds.
traceProvider
Property
traceProvider: NodeTracerProviderNode tracer provider owned by this client instance.
Methods
14 entries
delete
Method
delete<T>(path: string, options?: HttpClientRequestOptions, payload?: unknown): Promise<T>DELETE request.
execute
Method
execute(method: string, path: string, options?: HttpClientRequestOptions, payload?: unknown): Promise<any>Helper method
get
Method
get<T>(path: string, options?: HttpClientRequestOptions): Promise<T>GET request.
getSecret
Method
getSecret(name: string): Promise<string | undefined>Reads and decrypts a single shared Infisical secret.
getServiceTokenData
Method
getServiceTokenData(): Promise<TokenData>Fetches service-token metadata and decrypts the project key for later calls.
getTracer
Method
getTracer(): TracerReturns OpenTelemetry tracer of this client.
getUrlAndHeader
Method
getUrlAndHeader(path: string, options?: HttpClientRequestOptions): { headers: Record<string, string>; url: URL }patch
Method
patch<T>(path: string, payload: unknown, options?: HttpClientRequestOptions): Promise<T>PATCH request with an optional JSON payload.
post
Method
post<T>(path: string, payload: unknown, options?: HttpClientRequestOptions): Promise<T>POST request with an optional JSON payload.
put
Method
put<T>(path: string, payload: unknown, options?: HttpClientRequestOptions): Promise<T>PUT request with an optional JSON payload.
removeSecret
Method
removeSecret(name: string): Promise<void>Removes a shared Infisical secret from the token's first environment scope.
setBearerToken
Method
setBearerToken(token: string | undefined): voidSet the bearer token for all following requests.
setSecret
Method
setSecret(name: string, value: string): Promise<void>Creates or updates a shared Infisical secret.
startActiveSpan
Method
startActiveSpan<F>(name: string, opts: SpanOptions, context: Context | undefined, fn: (span: Span) => Promise<F>): Promise<F>Start a child span for OpenTelemetry tracking.