@layer8systems/sdk
v0.2.0
Published
Official TypeScript client for the Layer8 Systems public API (NetMapr, AssetTrakr, NoteTakr).
Maintainers
Readme
@layer8systems/sdk
Official TypeScript client for the Layer8 Systems public API — programmatic access to NetMapr maps, AssetTrakr assets, and NoteTakr note metadata.
Generate an API key from Settings → API Keys in the app, then:
import { Layer8Client } from '@layer8systems/sdk';
const layer8 = new Layer8Client({ apiKey: process.env.LAYER8_API_KEY! });
const assets = await layer8.assets.list({ status: 'active' });
const { id } = await layer8.assets.create({
name: 'core-switch-01',
type: 'switch',
status: 'active',
});
await layer8.assets.update(id, { location: 'Rack 4, U12' });
const maps = await layer8.maps.list();
const runbooks = await layer8.notes.list({ type: 'runbook' });Note content itself is never returned by the API — NoteTakr encrypts note bodies client-side, so notes.list/notes.get only return metadata (title, type, tags).
Error handling
Failed requests throw Layer8ApiError, with the HTTP status and parsed response body attached:
import { Layer8ApiError } from '@layer8systems/sdk';
try {
await layer8.assets.get('does-not-exist');
} catch (err) {
if (err instanceof Layer8ApiError && err.status === 404) {
// handle not-found
}
}Local/dev usage
Point the client at a non-production deployment with baseUrl:
new Layer8Client({ apiKey, baseUrl: 'http://localhost:3000/api' });Full endpoint reference: /docs/api in the app, or public/openapi.json.
