Skip to content

b3-business/hostingde

Repository files navigation

@b3-business/hostingde

A tree-shakeable API client for hosting.de built on top of @b3-business/cherry.

Installation

npm install @b3-business/hostingde
# or
pnpm add @b3-business/hostingde
# or
bun add @b3-business/hostingde

Quick start

import { 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 });

API characteristics

hosting.de has a few special API rules, handled automatically by this client:

  • All endpoints are POST
  • authToken must be sent in the JSON body
  • Responses are wrapped ({ status, response, metadata, errors, warnings })

Available DNS routes

  • zonesFind
  • zoneConfigsFind
  • recordsFind
  • nameserverSetsFind
  • templatesFind
  • zoneUpdate

Development

Install and type-check:

bun install
bun run env:check
bun run typecheck

Run tests:

bun test

bun 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.jb

Bun 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 build

License

MIT

About

Tree-shakeable hosting.de API client built on @b3-business/cherry

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors