Skip to main content
The box package on npm bundles the Box Node SDK and the Box CLI into a single install. Use it to add Box to a JavaScript or TypeScript project — and to run Box CLI commands — with one command.

What’s included

npm install box installs two direct dependencies:
  • Box Node SDK, exposed at the box/sdk subpath.
  • Box CLI, exposed via npx box.
TypeScript types are included.

Prerequisites

Install Node.js 22 or later.

Install

npm install box
The package works with npm, yarn, pnpm, and bun.

Use the SDK

Import the SDK from the box/sdk subpath:
import BoxSDK from 'box/sdk';  // ESM
const BoxSDK = require('box/sdk');  // CommonJS
For SDK usage and authentication, see Install the Node SDK and the authentication guides.
Stable alias. You can also import the SDK from the package root with import BoxSDK from 'box'. This returns the same SDK and is designed to remain stable across future changes to the underlying package.

Use the CLI

Run any CLI command with npx box:
npx box --help
npx box login
npx box users:get me
No separate CLI install is required. For full CLI documentation, see the CLI overview.

Continuous integration

The package is CI-safe. The post-install message is skipped when any of the following are true:
  • The CI environment variable is set to true.
  • The SUPPRESS_BOX_INSTALL_MESSAGE environment variable is set.
  • The install runs with --ignore-scripts.
No network requests are made during or after installation. All Box API traffic happens through the Box SDK and CLI at runtime, using your application’s authentication.

Security

Every release includes cryptographic provenance attestations that are verifiable against the official GitHub repository.

Not a browser package

The box package is for Node.js. To embed Box UI components in a browser application, install box-ui-elements separately.

Existing box-node-sdk users

No migration is required. If box-node-sdk works for you, leave it. The box package is for developers — and their coding agents — starting fresh. Existing code is unaffected.

Open source

The box package is open source under the Apache 2.0 license at github.com/box/npm-box. Contributions go through pull requests against that repository.