> ## Documentation Index
> Fetch the complete documentation index at: https://sferadev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# nuki-api-js

> Type-safe Nuki Smart Lock API client

A type-safe API client for the [Nuki Web API](https://developer.nuki.io/), 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

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add nuki-api-js
  ```

  ```bash npm theme={null}
  npm install nuki-api-js
  ```

  ```bash yarn theme={null}
  yarn add nuki-api-js
  ```
</CodeGroup>

## Usage

### Basic Usage

```typescript theme={null}
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

```typescript theme={null}
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](https://developer.nuki.io/).
