Everything on the following pages is reachable over plain HTTP, and everything on the following pages already has a typed method in @goenvless/sdk for TypeScript, in envless-sdk for Python and for Ruby, and in envless/sdk for PHP. Unless you are working in a language none of them covers, use an SDK.
npm install @goenvless/sdkpip install envless-sdkbundle add envless-sdkcomposer require envless/sdkimport { createClient } from '@goenvless/sdk'
const envless = createClient({ token: process.env.ENVLESS_TOKEN })
const workspace = await envless.workspace.get()
for await (const project of envless.projects.iterate()) {
console.log(project.slug)
}import os
from envless import Envless
envless = Envless(os.environ['ENVLESS_TOKEN'])
workspace = envless.workspace.get()
for project in envless.projects.iterate():
print(project['slug'])require "envless/sdk"
envless = Envless::Client.new(token: ENV.fetch("ENVLESS_TOKEN"))
workspace = envless.workspace.get
envless.projects.iterate do |project|
puts "#{workspace[:slug]} #{project[:slug]}"
enduse Envless\Envless;
$envless = new Envless(token: (string) getenv('ENVLESS_TOKEN'));
$workspace = $envless->workspace->get();
foreach ($envless->projects->iterate() as $project) {
echo $workspace['slug'], ' ', $project['slug'], PHP_EOL;
}What it saves you
| Doing it by hand | With the SDK |
|---|---|
Unwrap the { success, code, message, error, data } envelope on every response | Methods resolve to data, or throw |
Parse error.code out of a failure body yourself | EnvlessApiError with code, resource, field, requestId |
Walk limit and offset until hasMore is false | list, listAll, iterate on every collection |
| Decide which methods are safe to retry | GET, HEAD, PUT and DELETE retry on 408, 429, 500, 502, 503 and 504, with backoff and a numeric Retry-After honoured. POST and PATCH never retry |
| Implement PBKDF2 and AES-GCM to the exact recipe | encryptValue, decryptValue, ENCRYPTION_PARAMETERS |
| Re-encrypt version history by hand when rotating a passphrase | rotateWorkspacePassphrase walks live values and history |
| Hand-roll HMAC verification for incoming webhooks | verifyWebhookSignature |
The Python SDK has every one of these under its snake_case name, list_all, encrypt_value, rotate_workspace_passphrase and verify_webhook_signature, with request_id on its errors and an AsyncEnvless for asyncio and trio.
The Ruby SDK has them under the same snake_case names too, with request_id and predicates such as not_found? on Envless::ApiError, an Enumerator from iterate, and RBS types for every call.
The PHP SDK keeps the TypeScript names exactly, with encryptValue, rotateWorkspacePassphrase and verifyWebhookSignature as static methods on Envless\Envless, errorCode and requestId on Envless\Exception\ApiException, a Generator from iterate, and PHPStan and Psalm types for every call.
Coverage is enforced, not claimed. The TypeScript SDK runs a parity check against this openapi.json on every build and fails if any documented operation lacks a method, or any method points at an operation that does not exist. The Python, Ruby and PHP SDKs each run their own check, which replays every method against the requests the TypeScript SDK sends and fails on any difference.
The packages and their jobs
| Package | Job |
|---|---|
@goenvless/sdk | Administers a workspace from TypeScript. Authenticates with an API key. |
envless-sdk | Administers a workspace from Python, sync or async. The same methods, on PyPI. |
envless-sdk | Administers a workspace from Ruby. The same methods, on RubyGems. |
envless/sdk | Administers a workspace from PHP. The same methods, on Packagist. |
@goenvless/env | Loads variables into a running app. Library only, no terminal command. |
envless-env | Loads variables into a running Python app. The same loader, on PyPI. |
envless/env | Loads variables into a running PHP app. The same loader, on Packagist. |
@goenvless/cli | Ships the envless terminal binary. Nothing importable. |
| This HTTP API | The wire protocol underneath all of them. |
TypeScript SDK
Install it, create a client, and read the per-method reference.
Python SDK
pip install envless-sdk, then the same methods with Envless or AsyncEnvless.
Ruby SDK
bundle add envless-sdk, then the same methods on Envless.variables and the rest.
PHP SDK
composer require envless/sdk, then the same methods on $envless->variables and the rest.
Authentication
API keys, scopes, and project fences, at the HTTP level.