A tree-shakeable API client for hosting.de built on top of @b3-business/cherry.
npm install @b3-business/hostingde
# or
pnpm add @b3-business/hostingde
# or
bun add @b3-business/hostingdeimport { createHostingDeClient, zonesFind } from "@b3-business/hostingde";
const client = createHostingDeClient({
apiToken: process.env.HOSTING_DE_API_TOKEN!,
routes: { zonesFind },
});
const result = await client.zonesFind({ limit: 10 });hosting.de has a few special API rules, handled automatically by this client:
- All endpoints are
POST authTokenmust be sent in the JSON body- Responses are wrapped (
{ status, response, metadata, errors, warnings })
zonesFindzoneConfigsFindrecordsFindnameserverSetsFindtemplatesFindzoneUpdate
Install and type-check:
bun install
bun run env:check
bun run typecheckRun tests:
bun testbun test includes live DNS integration tests from test/dns-integration.test.ts.
These tests fail fast if HOSTING_DE_API_TOKEN_TEST1 is missing.
Configuration is defined in the committed .env.schema. This repo uses the
Varlock profile selector pattern: committed .env.jb contains portable resolver
references, and package scripts select DEV_ENV=jb inline for local commands.
For local macOS secrets, keep exported env variable names unchanged, but store
Keychain items with service varlock and account
hostingde:<profile>:<ENV_VAR_NAME>. The committed jb profile uses native
Varlock Keychain refs:
HOSTING_DE_API_TOKEN=keychain(service="varlock", account="hostingde:jb:HOSTING_DE_API_TOKEN")
HOSTING_DE_API_TOKEN_TEST1=keychain(service="varlock", account="hostingde:jb:HOSTING_DE_API_TOKEN_TEST1")When creating Keychain items, include provenance in the item name/comment/label
where Keychain supports it: env var name, project slug hostingde, absolute repo
path /Users/bjesuiter/Develop/b3-business/hostingde, and that it is a local dev
secret. Current Varlock Keychain prompt mode does not expose a documented option
to customize the picker heading from Select Keychain Item for <ENV_VAR_NAME>;
use scoped item labels/accounts so selectable entries show the project context.
Import a plaintext env file into Varlock-compatible Keychain items without printing
values:
varlock keychain import .env --project hostingde --profile jb --write-to .env.jbBun automatic .env loading is disabled in bunfig.toml; use the Varlock-wrapped
scripts so Varlock injects env into runtime commands. The live tests require
HOSTING_DE_API_TOKEN_TEST1; HOSTINGDE_API_DEMO_HOST and HOSTINGDE_API_HOST
are optional host overrides.
Build:
bun run buildMIT