Vault | Node.js SDK | Secrets Endpoints
Secrets Endpoints
Secret rotate
secretRotate(request: RotateRequest): Promise<PangeaResponse<RotateResult>>Rotate a secret.
const response = await vault.secretRotate(
{
id: "pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5",
secret: "12sdfgs4543qv@#%$casd",
rotation_state: Vault.ItemVersionState.DEACTIVATED,
}
);
Secret store
secretStore(request: StoreRequest): Promise<PangeaResponse<StoreResult>>Import a secret.
const response = await vault.secretStore(
{
secret: "12sdfgs4543qv@#%$casd",
name: "my-very-secret-secret",
folder: "/personal",
metadata: {
"created_by": "John Doe",
"used_in": "Google products"
},
tags: ["irs_2023", "personal"],
rotation_frequency: "10d",
rotation_state: Vault.ItemVersionState.DEACTIVATED,
expiration: "2025-01-01T10:00:00Z",
}
);