Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 609 Bytes

USAGE.md

File metadata and controls

28 lines (23 loc) · 609 Bytes
import { Circleci } from "circleci-v2-sdk";

async function run() {
    const sdk = new Circleci({
        security: {
            apiKeyHeader: "<YOUR_API_KEY_HERE>",
        },
    });

    const res = await sdk.context.addEnvironmentVariableToContext({
        requestBody: {
            value: "some-secret-value",
        },
        contextId: "0407a4cd-7d9d-4359-a2ad-0a7c67c0ba96",
        envVarName: "POSTGRES_USER",
    });

    if (res.statusCode == 200) {
        // handle response
    }
}

run();