Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pratyay360/podman-ts/llms.txt
Use this file to discover all available pages before exploring further.
SecretsManager is the interface for working with Podman secrets. Access it via client.secrets on any PodmanClient instance. Secrets are named, encrypted blobs — passwords, tokens, certificates — that Podman stores securely and can inject into containers at runtime without exposing them in environment variables or image layers.
SecretsManager methods
create
Secret instance.
Name for the secret. Must be unique within the Podman daemon.
The secret payload. Pass a
string for text secrets (sent as UTF-8). Pass a Buffer for binary secrets — the SDK converts it to a Uint8Array before transmission.Secret driver to use (e.g.
"file"). Defaults to the daemon’s default driver.Driver-specific options.
Labels to attach to the secret.
If
true, replace an existing secret with the same name rather than returning an error.If
true, silently succeed when a secret with the same name already exists instead of replacing it.When
data is a Buffer, the SDK wraps it in a Uint8Array and omits the Content-Type header so the raw bytes are sent as-is. For string data, Content-Type: text/plain; charset=utf-8 is set automatically.list
Key/value filters applied server-side. Common keys include
name and label.get
NotFound if the secret does not exist.
exists
true if a secret with the given ID or name exists, false otherwise.
remove
NotFound if the secret does not exist.
Remove all secrets. When set,
secretId is ignored.Secret instance methods
ASecret object is returned by create(), get(), and list(). It exposes the following:
| Property / Method | Type / Signature | Description |
|---|---|---|
id | string | undefined | The secret’s unique ID. |
name | string | The secret’s name, read from attrs.Spec.Name. |
remove | (options?: { all?: boolean }): Promise<void> | Remove this secret. Pass all: true to delete all secrets in one call. |
Code examples
Create a secret from a string
Create a secret from a Buffer
Passing a
Buffer sends the raw bytes as a Uint8Array without a Content-Type header. This is the correct approach for binary payloads such as certificates or keystore files.