Registry / devops / bitbucket-data-center-client

bitbucket-data-center-client

JSON →
library1.4.33jsnpmunverified

TypeScript client library for Bitbucket Server/Data Center REST API, version 1.4.33. Maintained as of 2025. Provides typed HTTP client wrappers with full TypeScript declarations for the Bitbucket Data Center REST API. Differentiates from generic HTTP clients by offering auto-completion, error handling, and pagination support natively. Currently in active development with monthly releases.

npm install bitbucket-data-center-client
INSTALL
IMPORT
SIG · BITBUCKET-DATA-CEN
B
bitbucket-data-center-client
devopsjavascriptv1.4.33
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

BitbucketClient
import { BitbucketClient } from 'bitbucket-data-center-client'
const BitbucketClient = require('bitbucket-data-center-client')
ESM-only since v1.0.0; requires Node >= 22.
ProjectAPI
import { ProjectAPI } from 'bitbucket-data-center-client'
import { ProjectApi } from 'bitbucket-data-center-client'
Named export uses PascalCase with 'API' suffix.
RepositoryAPI
import { RepositoryAPI } from 'bitbucket-data-center-client'
const { RepositoryAPI } = require('bitbucket-data-center-client')
CJS require not supported; use dynamic import at runtime if needed.

Initialize client with basic auth and list all projects.

import { BitbucketClient } from 'bitbucket-data-center-client'; const client = new BitbucketClient({ baseUrl: 'https://your-bitbucket-server.com', auth: { username: process.env.BITBUCKET_USERNAME ?? '', password: process.env.BITBUCKET_PASSWORD ?? '' } }); async function getProjects() { try { const projects = await client.projects.list(); console.log(projects); } catch (error) { console.error(error); } } getProjects();
Debug
Known issues
gotchabaseUrl must not include trailing slash
fix
Ensure baseUrl ends without a slash, e.g., https://your-bitbucket-server.com
affects: >=1.0.0
deprecatedBasic auth over HTTPS is deprecated; use OAuth or personal access tokens.
fix
Migrate to token-based auth using the auth.token property.
affects: >=1.4.0
breakingNode.js <22.0.0 is not supported
fix
Update Node.js to version 22 or later.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: client.projects.list is not a function
Client not properly initialized or API endpoint not available
fix
Ensure you call new BitbucketClient() with valid config and check the API path exists.
AxiosError: Request failed with status code 401
Invalid credentials or missing authentication
fix
Verify username and password or token are correct.
ERR_REQUIRE_ESM
Using require() on an ESM-only module
fix
Convert to ES module or use dynamic import: const client = await import('bitbucket-data-center-client');
Upgrade
Version history
1.4.33latest on npm
Audit
Dependencies
axiosrequiredHTTP client for REST API calls
Agent activity
18 hits · last 30 days
node
12
Resources
bitbucket-data-center-client — npm install bitbucket-data-center-client · libregistry