Skip to main content
A type-safe API client for the Nuki Web API, auto-generated from the official OpenAPI specification with full TypeScript support.

Features

  • Type-Safe - Full TypeScript support with auto-generated types from OpenAPI spec
  • Smart Lock Control - Complete smart lock management
  • Auto-Updated - Daily regeneration from upstream OpenAPI specs

Installation

pnpm add nuki-api-js

Usage

Basic Usage

import { createClient } from "nuki-api-js";

const client = createClient({
  baseUrl: "https://api.nuki.io",
  headers: {
    Authorization: `Bearer ${process.env.NUKI_API_TOKEN}`,
  },
});

// List smart locks
const smartLocks = await client.getSmartLocks();

// Get smart lock details
const lock = await client.getSmartLock({
  smartlockId: "your-lock-id",
});

// Lock/Unlock
await client.setSmartLockAction({
  smartlockId: "your-lock-id",
  body: {
    action: 1, // Lock
  },
});

Type Exports

import type { Types } from "nuki-api-js";

// Use TypeScript types
type SmartLock = Types.SmartLock;
type SmartLockLog = Types.SmartLockLog;

API Reference

The client exposes Nuki API endpoints including:
  • Smart Locks - Lock management and control
  • Lock Actions - Lock, unlock, and other actions
  • Lock Logs - Activity log access
  • Users - User authorization management
  • And more…
For the complete API reference, see the Nuki Web API documentation.