Registry / storage / oci-objectstorage

oci-objectstorage

JSON →
library2.132.0jsnpmunverified

Official Oracle Cloud Infrastructure (OCI) SDK for Node.js to manage Object Storage service resources. Current stable version is 2.132.0, released as part of the OCI TypeScript SDK monorepo with weekly release cadence. Supports all Object Storage operations: buckets, objects, pre-authenticated requests, multipart uploads, and retention rules. Requires OCI account, IAM user with policies, and API signing key pair. Ships with TypeScript types. Differentiator: first-party SDK maintained by Oracle, supports all OCI regions and features, integrates with OCI authentication providers.

npm install oci-objectstorage
INSTALL
IMPORT
SIG · OCI-OBJECTSTORAGE
O
oci-objectstorage
storagejavascriptv2.132.0
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.

ObjectStorageClient
✓ import { ObjectStorageClient } from 'oci-objectstorage'
✗ const ObjectStorageClient = require('oci-objectstorage').ObjectStorageClient
ESM import is recommended in TypeScript/ES modules; CJS require also works but destructure the named export.
models
✓ import * as models from 'oci-objectstorage/lib/models'
✗ import models from 'oci-objectstorage'
Models are in a subpath; use explicit lib path.
requests
✓ import { ListObjectsRequest } from 'oci-objectstorage/lib/requests'
✗ import ListObjectsRequest from 'oci-objectstorage'
Request types are also in subpaths; check docs for correct import.
common
✓ import { common } from 'oci-common'
✗ import { common } from 'oci-objectstorage'
Common utilities like auth providers come from 'oci-common' package.

Authenticate using OCI config file and list all buckets in a compartment.

import { ObjectStorageClient } from 'oci-objectstorage'; import { common } from 'oci-common'; const provider = new common.ConfigFileAuthenticationDetailsProvider(); const client = new ObjectStorageClient({ authenticationDetailsProvider: provider }); async function listBuckets() { const namespaceName = (await client.getNamespace({})).value; const compartmentId = process.env.COMPARTMENT_OCID!; const response = await client.listBuckets({ namespaceName, compartmentId }); console.log(response.items); } listBuckets();
Debug
Known issues
breakingoci-objectstorage v2.x moved to monorepo; imports changed from 'oci-objectstorage' to subpaths for models and requests.
fix
Update import paths to include '/lib/models', '/lib/requests' etc.
affects: >=2.0.0
deprecatedUsing ConfigFileAuthenticationDetailsProvider without region setting may cause errors in some regions.
fix
Set region explicitly in config or via environment variable OCI_REGION.
affects: >=1.0.0
gotchaListObjectsRequest does not return object content; you must call getObject separately.
fix
Use client.getObject({...}) with the object name and bucket name from list results.
affects: >=1.0.0
gotchaAll API calls are async and return promises; errors are of type OciError with statusCode and serviceCode.
fix
Catch errors with try/catch and inspect error.statusCode for HTTP status.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Missing required parameter 'namespaceName'
Namespace name not provided in listBuckets request.
fix
Call getNamespace() first to retrieve namespace name or set it from environment variable.
TypeError: Cannot read properties of undefined (reading 'authenticationDetailsProvider')
AuthenticationDetailsProvider not passed to client constructor.
fix
Instantiate provider (e.g., new common.ConfigFileAuthenticationDetailsProvider()) and pass it in client options.
Error: NotAuthenticated
OCI authentication failed; missing or invalid config file or API key.
fix
Ensure ~/.oci/config exists with correct user, fingerprint, tenancy, and key_file paths.
Upgrade
Version history
2.132.0latest on npm
Audit
Dependencies
oci-commonrequiredOCI common SDK for authentication, HTTP handling, and signing
Agent activity
21 hits · last 30 days
node
19
Amazon
1
OpenAI (training)
1
Resources
oci-objectstorage — npm install oci-objectstorage · libregistry