Registry / communication / commandbar

commandbar

JSON →
library1.14.0jsnpmunverified

CommandBar is a JavaScript/TypeScript SDK designed to embed an AI-powered command bar and user assistance platform into web and mobile applications. It allows developers to add contextual help, searchable commands, in-app guides, checklists, nudges, and product tours, acting as a dynamic, embedded wiki for application functionality and support. The current stable npm package version is 1.14.0. While the npm package itself was last published two years ago, the underlying CommandBar service and its features, such as the AI Copilot and mobile support, are actively developed. Key differentiators include its AI capabilities for user assistance, robust mobile application support via dedicated SDKs (iOS, Android, React Native), and a comprehensive suite of tools for digital adoption and user engagement, contrasting with simpler command palettes or generic UI libraries.

npm install commandbar
INSTALL
IMPORT
SIG · COMMANDBAR
C
commandbar
communicationjavascriptv1.14.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

init
import { init } from 'commandbar';
const init = require('commandbar').init;
The `init` function must be called once with your organization ID before `window.CommandBar.boot` or any other SDK methods are used.
boot
window.CommandBar.boot(userId);
import { boot } from 'commandbar'; boot(userId);
After `init` is called, the core CommandBar instance is exposed globally on `window.CommandBar`. The `boot` method is accessed via this global object and is crucial for identifying the user and making CommandBar available.
addCommands
window.CommandBar.addCommands([/* commands */]);
import { addCommands } from 'commandbar';
Like `boot`, `addCommands` is a method on the global `window.CommandBar` object, used to programmatically add custom commands to the bar.
Types
import type { CommandBarOptions, Command } from 'commandbar';
The library ships with built-in TypeScript types, which are beneficial for development in TypeScript projects.

This quickstart demonstrates how to initialize the CommandBar SDK with an organization ID and then 'boot' it for a specific user, including how to add a custom command. This sequence is essential for the CommandBar UI to appear and function correctly in your application.

import { init } from 'commandbar'; // Initialize CommandBar with your organization ID. // This should typically run once when your application starts. const MY_ORG_ID = process.env.COMMANDBAR_ORG_ID ?? 'YOUR_ORGANIZATION_ID'; // Replace with your actual ID init(MY_ORG_ID); // Simulate a user authentication flow and boot CommandBar for the identified user. function initializeUserCommandBar(userID: string) { if (typeof window.CommandBar !== 'undefined' && window.CommandBar.boot) { window.CommandBar.boot(userID, { // Optional user properties for analytics and targeting plan: 'pro', signedUpDate: new Date().toISOString() }); console.log(`CommandBar booted for user: ${userID}`); // Example of adding a custom command window.CommandBar.addCommands([ { id: 'navigate-dashboard', name: 'Go to Dashboard', description: 'Navigates to the main user dashboard.', handler: () => { alert('Navigating to dashboard...'); // In a real app, you'd use your router here: e.g., router.push('/dashboard'); }, // You can add additional metadata for filtering, etc. category: 'Navigation' } ]); console.log('Custom command added: Go to Dashboard'); } else { console.error('CommandBar is not initialized or available globally.'); } } // Example usage: Call this function after a user logs in or is identified. const authenticatedUserID = 'user_12345'; // Replace with actual authenticated user ID initializeUserCommandBar(authenticatedUserID); // You can also boot for anonymous users if needed (pass null or an empty string for userID) // initializeUserCommandBar(null);
Debug
Known issues
gotchaThe `commandbar` npm package has a last publish date of 2 years ago (version 1.14.0). While the core library is stable, the CommandBar service itself is actively developed with newer features like AI Copilot and mobile support, which may involve server-side updates or separate mobile SDKs rather than new npm package versions. Ensure your expectations align with this release cadence for the JavaScript SDK.
fix
Monitor CommandBar's official documentation for announcements regarding new versions or updates to their web SDK, and consider the implications of a less frequently updated npm package for new feature adoption.
affects: <=1.14.0
gotchaInitialization order is critical. The `init` function must be called first with your `orgId` before `window.CommandBar.boot` or any other SDK methods are invoked. Calling other methods before `init` will result in errors.
fix
Ensure `init(ORG_ID)` is executed once at the earliest possible stage in your application's lifecycle, typically before any UI components that might interact with CommandBar are mounted or rendered.
affects: >=1.0.0
gotchaAfter initialization, the CommandBar SDK exposes its API primarily through a global `window.CommandBar` object. Directly importing methods like `boot` or `addCommands` from the package will not work as they are not exported for direct module consumption in this manner; they are designed to be accessed from the global instance.
fix
Always interact with the SDK methods via `window.CommandBar.methodName(...)` after `init` has successfully run. If `window.CommandBar` is undefined, ensure `init` was called correctly and the script had time to load.
affects: >=1.0.0
gotchaBoth `init` and `boot` functions require mandatory arguments (`orgId` for `init` and `userId` for `boot`). Failing to provide these will lead to runtime errors and CommandBar will not function.
fix
Always pass your valid CommandBar organization ID to `init` and an authenticated user ID (or `null` for anonymous users) to `boot`. Validate these values before calling the functions.
affects: >=1.0.0
Errors
Common errors & fixes
ReferenceError: CommandBar is not defined
The CommandBar SDK script has not been loaded or the `init` function has not been called before attempting to access `window.CommandBar`.
fix
Ensure `import { init } from 'commandbar'; init('YOUR_ORG_ID');` has been executed successfully before any calls to `window.CommandBar` methods. For non-module usage, verify the `<script>` tag for CommandBar's snippet is correctly placed and loaded in your HTML.
TypeError: window.CommandBar.boot is not a function
The `init` function was either not called or failed, meaning the `window.CommandBar` object was not properly populated with its API methods.
fix
Check that `init('YOUR_ORG_ID')` is called exactly once and completes without errors before any subsequent calls to `window.CommandBar.boot` or other `window.CommandBar` methods.
Error: init requires an orgId
The `init` function was called without providing the required organization ID string.
fix
Provide your unique CommandBar organization ID as the first argument to `init`, e.g., `init('YOUR_ORGANIZATION_ID');`.
Error: boot requires a userId
The `window.CommandBar.boot` function was called without providing the required user ID string.
fix
Pass a valid authenticated user ID string as the first argument to `window.CommandBar.boot`, e.g., `window.CommandBar.boot(authenticatedUserID);`. For anonymous users, pass `null` or an empty string as explicitly documented.
Upgrade
Version history
1.14.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
38
OpenAI (training)
1
Resources