Registry / http-networking / box-typescript-sdk-gen

box-typescript-sdk-gen

JSON →
library1.19.1jsnpmunverified

Official Box TypeScript SDK generated from the Box OpenAPI specification. Current stable version is 1.19.1, with frequent releases (multiple per month) as part of an auto-generation pipeline. It provides full coverage of the Box API, including AI, classification, chunk uploads, webhooks, and sign requests. Supports both ESM and CJS, includes TypeScript types, and offers built-in retries with exponential backoff, authentication, and request cancellation. Key differentiators vs older Box SDKs: rapid API updates (days vs months), embedded documentation via JSDoc, and generated code consistency across languages. Requires Node.js >=16.

npm install box-typescript-sdk-gen
INSTALL
IMPORT
SIG · BOX-TYPESCRIPT-SDK
B
box-typescript-sdk-gen
http-networkingjavascriptv1.19.1
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.

BoxClient
import { BoxClient } from 'box-typescript-sdk-gen'
import BoxClient from 'box-typescript-sdk-gen'
BoxClient is a named export, not default. ESM import is required for tree-shaking; CJS require is also valid.
BoxDeveloperTokenAuth
import { BoxDeveloperTokenAuth } from 'box-typescript-sdk-gen'
import { DeveloperTokenAuth } from 'box-typescript-sdk-gen'
Class name includes 'Box' prefix, consistent with other auth types like BoxJWT, BoxCCG.
BoxOAuth
import { BoxOAuth } from 'box-typescript-sdk-gen'
const BoxOAuth = require('box-typescript-sdk-gen').BoxOAuth
Both ESM and CJS work, but TypeScript expects named import for type inference.

Authenticate with a developer token and retrieve current user info and root folder contents.

import { BoxClient, BoxDeveloperTokenAuth } from 'box-typescript-sdk-gen'; const auth = new BoxDeveloperTokenAuth({ token: process.env.BOX_DEV_TOKEN ?? '' }); const client = new BoxClient({ auth }); async function main() { const me = await client.users.getUserById({ userId: 'me' }); console.log(`Logged in as ${me.name} (${me.login})`); const items = await client.folders.getFolderItems({ folderId: '0' }); for (const item of items.entries) { console.log(`${item.type}: ${item.name}`); } } main().catch(console.error);
Debug
Known issues
gotchaESM imports must use named exports; default import is not available.
fix
Use import { BoxClient } from 'box-typescript-sdk-gen' instead of import BoxClient from 'box-typescript-sdk-gen'.
affects: >=1.0.0
deprecatedOld Box TypeScript SDK (non-generated) is deprecated; migrate to this SDK.
fix
Replace old import paths with new generated SDK.
affects: <1.0.0
breakingConstructor arguments for auth classes changed to object parameter in v1.0.0.
fix
Pass auth config as an object: new BoxDeveloperTokenAuth({ token: '...' }).
affects: >=1.0.0
gotchaNode.js >=16 required; the SDK does not work in older Node versions due to fetch and other modern APIs.
fix
Upgrade Node.js to version 16 or later.
affects: >=1.0.0
deprecatedCJS require() works but is not recommended; ESM is preferred for tree-shaking and type safety.
fix
Use ESM imports (import ... from ...).
affects: >=1.0.0
breakingIn v1.18.0, form-data was bumped to 4.0.4, which may cause issues with older Node.js fetch implementations.
fix
Update to v1.19.1 or later which fixes ESM build.
affects: >=1.18.0 <1.19.0
gotchaWebhook signature verification changed in v1.16.0: body is now escaped before signing.
fix
Use the updated verifySignature method which handles both escaped and unescaped bodies.
affects: >=1.16.0
Errors
Common errors & fixes
Cannot find module 'box-typescript-sdk-gen'
Package not installed or wrong import path.
fix
Run 'npm install box-typescript-sdk-gen' and ensure your Node.js version is >=16.
TypeError: BoxClient is not a constructor
Default import used instead of named import (or wrong import style).
fix
Use 'import { BoxClient } from 'box-typescript-sdk-gen'' (curly braces).
Uncaught TypeError: Cannot read properties of undefined (reading 'getUserById')
BoxClient not properly initialized due to missing auth or invalid token.
fix
Ensure authentication is set up correctly, e.g., new BoxDeveloperTokenAuth({ token: process.env.BOX_DEV_TOKEN }) and pass to BoxClient.
Error: connect ECONNREFUSED 127.0.0.1:443
Network issue; the SDK cannot reach Box API endpoints.
fix
Check network connectivity and proxy settings. Ensure the environment allows outbound HTTPS requests.
Upgrade
Version history
1.19.1latest on npm
Audit
Dependencies
form-datarequiredUsed for multipart form data requests
node-fetchrequiredHTTP client for API calls
Agent activity
45 hits · last 30 days
node
40
OpenAI (training)
1
Resources
box-typescript-sdk-gen — npm install box-typescript-sdk-gen · libregistry