1Password
Source server variables from 1Password Secrets Automation.
bun add @1password/sdk
import {
configureResolver,
createEnv,
fromResolver,
requiredString,
server,
} from "@ayronforge/envil";
import { onePasswordSecretsAdapter } from "@ayronforge/envil/1password";
const onePassword = configureResolver(onePasswordSecretsAdapter, {
serviceAccountToken: process.env.OP_SERVICE_ACCOUNT_TOKEN,
});
export const appEnv = createEnv(
server({
API_TOKEN: requiredString.pipe(
fromResolver(onePassword, "op://vault/item/field"),
),
}),
);
If serviceAccountToken is omitted, the adapter reads
OP_SERVICE_ACCOUNT_TOKEN. Variables using the same configured resolver are
sent through one resolveAll request.