Skip to main content

@conductor/unkey

Unkey authentication plugin for Conductor. Provides API key validation, creation, and management using Unkey.

Installation

Configuration

Environment Variables

Required:
  • UNKEY_ROOT_KEY - Unkey root key for management operations
Optional:
  • UNKEY_API_ID - Default Unkey API ID (can be overridden per operation)

Operations

unkey:validate

Validate an API key with Unkey. Config:
  • apiKey (string, required) - API key to validate
  • apiId (string, optional) - Unkey API ID
Returns:
  • valid (boolean) - Whether the key is valid
  • keyId (string | null) - Key ID if valid
  • ownerId (string | null) - Owner ID if valid
  • meta (object | null) - Key metadata
  • remaining (number | null) - Remaining requests
  • error (string | null) - Error message if invalid
Example:

unkey:create

Create a new API key. Config:
  • apiId (string, optional) - Unkey API ID
  • prefix (string, optional) - Key prefix
  • byteLength (number, optional) - Bytes of randomness (default: 16)
  • ownerId (string, optional) - Owner ID
  • meta (object, optional) - Key metadata
  • expires (number, optional) - Expiration timestamp (ms)
  • remaining (number, optional) - Remaining requests
  • refill (object, optional) - Refill configuration
  • ratelimit (object, optional) - Rate limit configuration
Returns:
  • key (string) - The generated API key
  • keyId (string) - The key ID
Example:

unkey:revoke

Revoke/delete an API key. Config:
  • keyId (string, required) - Key ID to revoke
Returns:
  • success (boolean) - Whether revocation succeeded
  • keyId (string) - The revoked key ID
Example:

Complete Example