Atomically manage encrypted provider credentials with the Phoenix TypeScript client
Use upsertOrDeleteSecrets from the @arizeai/phoenix-client/secrets entrypoint to create, rotate, or delete encrypted provider credentials in one atomic request.
Managing secrets requires an administrator when Phoenix authentication is enabled. Do not log the request batch or retain its values outside your credential store.
Pass client when you need to target a particular Phoenix instance. Otherwise, the helper creates a client from the standard Phoenix environment configuration.
import { createClient } from "@arizeai/phoenix-client";import { upsertOrDeleteSecrets } from "@arizeai/phoenix-client/secrets";const apiKey = process.env.OPENAI_API_KEY;if (!apiKey) throw new Error("OPENAI_API_KEY is required");const client = createClient({ options: { baseUrl: "https://phoenix.example.com" },});await upsertOrDeleteSecrets({ client, secrets: [{ key: "OPENAI_API_KEY", value: apiKey }],});