inception-api
v1.0.11
Published
Inception API client library and CLI tool for controlling doors, areas, and security features
Maintainers
Readme
Inception API
A Node.js library and CLI tool for interacting with the Inception security system API. This package allows you to control doors, areas, outputs, and retrieve information from your Inception system.
Installation
npm install -g inception-apiCLI Usage
The CLI tool provides a convenient way to interact with your Inception system from the command line.
Global Options
-u, --url <url>- Base URL for Inception device-U, --username <username>- API username-P, --password <password>- API password-T, --token <token>- API authentication token (alternative to username/password)-v, --verbose- Enable verbose output (detailed JSON responses)-h, --help- Display help information
Authentication
You can authenticate using any of these methods:
- Command line arguments:
inception -u http://your-inception-server -U username -P password <command>
# OR using API token
inception -u http://your-inception-server -T your-token <command>- Environment variables:
export INCEPTION_URL=http://your-inception-server
export INCEPTION_USERNAME=username
export INCEPTION_PASSWORD=password
# OR
export INCEPTION_TOKEN=your-token
inception <command>- Stored credentials (saved after first login):
# First login saves credentials
inception -u http://your-inception-server -U username -P password login
# Subsequent commands use stored credentials
inception <command>- Interactive prompt (if no credentials provided):
inception <command>
# Will securely prompt for username and passwordConfig Management
# Show current config (with sensitive data hidden)
inception config --show
# Clear stored credentials
inception config --clearCommands
# Get protocol version (no auth required)
inception protocol
# Login (verifies credentials)
inception login
# Get area information
inception area
# Get detailed area summary
inception area-summary
# Arm an area
inception arm <areaID>
# Arm an area in Stay mode
inception stay <areaID>
# Disarm an area
inception disarm <areaID>
# Get outputs information
inception outputs
# Control an output (on, off, pulse)
inception output <outputID> <on|off|pulse>
# Get doors information
inception doors
# Get detailed door summary
inception door-summary
# Control a door (lock, unlock, momentary)
inception door <doorID> <lock|unlock|momentary>
# Submit a virtual badge at a door reader
inception badge <readerID> <templateID> <cardData>
# Submit a PIN to a door reader
inception pin <readerID> <pinData>
# List users
inception users
# Get user details
inception user <userID>
# Get review events
inception events [--limit <limit>] [--offset <offset>]
# Get notification events
inception notifications [--limit <limit>] [--offset <offset>]
# Monitor state changes (long polling)
inception monitor [--timeout <timeout>]
# Cycle a door
inception door-cycle <doorID> [delay]Library Usage
const InceptionAPI = require('inception-api');
// Initialize with username/password
const api = new InceptionAPI({
baseURL: 'http://your-inception-server'
});
// Authenticate with username/password
api.login('username', 'password')
.then(() => api.getDoorInformation())
.then(doors => {
console.log('Doors:', doors);
return api.controlDoor('door-id', 'Unlock');
})
.then(result => {
console.log('Door unlocked:', result);
})
.catch(err => {
console.error('Error:', err.message);
});
// OR initialize with token
const apiWithToken = new InceptionAPI({
baseURL: 'http://your-inception-server',
token: 'your-api-token'
});
// Now use without login
apiWithToken.getDoorInformation()
.then(doors => {
console.log('Doors:', doors);
})
.catch(err => {
console.error('Error:', err.message);
});Available Methods
getProtocolVersion()- Get API protocol versionlogin(username, password)- Authenticate usersetAuthToken(token)- Set authentication tokengetAreaInformation()- Get areas informationgetAreaSummaryInformation()- Get area summary informationarmArea(areaID)- Arm an areadisarmArea(areaID)- Disarm an areaarmAreaStay(areaID)- Arm area in Stay modegetOutputInformation()- Get outputs informationcontrolOutput(outputID, action)- Control output (On/Off/Pulse)getDoorInformation()- Get doors informationgetDoorSummaryInformation()- Get door summary informationcontrolDoor(doorID, action)- Control door (Lock/Unlock/MomentaryUnlock)submitActivity(activityData)- Submit an activity (e.g., virtual badge, PIN)getUsers()- List usersgetUser(userID)- Get user detailsgetReviewEvents(options)- Get review eventsgetNotificationEvents(options)- Get notification eventslongPoll(timeout)- Long polling for state changes
License
ISC
