Internal HTTP layer. Not part of the public API. Consumers should use pocketenv-io.pocketenv and pocketenv-io.sandbox.
Internal HTTP layer. Not part of the public API. Consumers should use pocketenv-io.pocketenv and pocketenv-io.sandbox.
Low-level HTTP client for the Pocketenv XRPC API.
Configuration (resolved in priority order):
Low-level HTTP client for the Pocketenv XRPC API.
Configuration (resolved in priority order):
- POCKETENV_API_URL env var (or default https://api.pocketenv.io)
- POCKETENV_TOKEN env var
- ~/.pocketenv/token.json file ({"token": "..."})Client-side encryption matching libsodium's crypto_box_seal (anonymous sealed box).
Algorithm:
The server's public key is resolved in order from:
Client-side encryption matching libsodium's crypto_box_seal (anonymous sealed box). Algorithm: 1. Generate ephemeral Curve25519 (X25519) keypair 2. Derive nonce = BLAKE2b-24(eph_pk || recipient_pk) — matches libsodium exactly 3. Encrypt with NaCl crypto_box(message, nonce, eph_sk, recipient_pk) 4. Output = eph_pk (32 bytes) || ciphertext 5. Base64url-encode without padding The server's public key is resolved in order from: 1. POCKETENV_PUBLIC_KEY environment variable 2. The default production key
Clojure SDK for the Pocketenv sandbox platform.
This namespace is the main entry point for the SDK. It returns Sandbox records that you pipe operations on using Clojure's threading macro:
(require '[pocketenv-io.pocketenv :as pocketenv] '[pocketenv-io.sandbox :as sandbox])
(-> (pocketenv/create-sandbox "my-box") (sandbox/start) (sandbox/wait-until-running) (sandbox/exec "clojure" ["-M:test"]))
Set any of the following environment variables:
POCKETENV_TOKEN — bearer token POCKETENV_API_URL — API base URL (default: https://api.pocketenv.io) POCKETENV_PUBLIC_KEY — server public key (hex-encoded)
Or place a token in ~/.pocketenv/token.json: {"token": "..."}
All functions return {:ok value} on success or {:error reason} on failure. Sandbox operation functions also accept {:ok sandbox} as their first argument so you can chain them with the -> threading macro without unwrapping.
Clojure SDK for the Pocketenv sandbox platform.
This namespace is the main entry point for the SDK. It returns Sandbox
records that you pipe operations on using Clojure's threading macro:
(require '[pocketenv-io.pocketenv :as pocketenv]
'[pocketenv-io.sandbox :as sandbox])
(-> (pocketenv/create-sandbox "my-box")
(sandbox/start)
(sandbox/wait-until-running)
(sandbox/exec "clojure" ["-M:test"]))
## Configuration
Set any of the following environment variables:
POCKETENV_TOKEN — bearer token
POCKETENV_API_URL — API base URL (default: https://api.pocketenv.io)
POCKETENV_PUBLIC_KEY — server public key (hex-encoded)
Or place a token in ~/.pocketenv/token.json: {"token": "..."}
## Return values
All functions return {:ok value} on success or {:error reason} on failure.
Sandbox operation functions also accept {:ok sandbox} as their first argument
so you can chain them with the -> threading macro without unwrapping.Sandbox record and pipe-safe operations.
The Sandbox record is the central type of the SDK. Obtain one from pocketenv-io.pocketenv/create-sandbox or get-sandbox, then pipe operations with Clojure's -> threading macro:
(-> (pocketenv/create-sandbox "my-box") (sandbox/start) (sandbox/wait-until-running) (sandbox/exec "clojure" ["-M:test"]))
Every operation accepts either a bare Sandbox record or an {:ok sandbox} result map, enabling seamless threading. Passing {:error reason} raises an exception, keeping error handling explicit.
Sandbox record and pipe-safe operations.
The Sandbox record is the central type of the SDK. Obtain one from
pocketenv-io.pocketenv/create-sandbox or get-sandbox, then pipe
operations with Clojure's -> threading macro:
(-> (pocketenv/create-sandbox "my-box")
(sandbox/start)
(sandbox/wait-until-running)
(sandbox/exec "clojure" ["-M:test"]))
Every operation accepts either a bare Sandbox record or an {:ok sandbox}
result map, enabling seamless threading. Passing {:error reason} raises
an exception, keeping error handling explicit.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |