The `object-storage-client` package provides a TypeScript and JavaScript client library for programmatic interaction with the Metorial Object Storage Service. It offers a comprehensive, promise-based API for managing buckets and objects, including creation, listing, uploading, downloading, and deletion. The current stable version, 0.2.5, indicates it is in early development and pre-1.0 stability, meaning minor versions might introduce breaking changes. Its key differentiators include strong TypeScript support, a direct interface to the Metorial Object Storage backend (which itself supports multiple storage backends like local filesystem, AWS S3, Google Cloud Storage, and Azure Blob Storage), and a straightforward API for asynchronous operations. This client is specifically designed for the Metorial ecosystem, which aims to connect AI agents to various tools and services.
npm install object-storage-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the full lifecycle of object storage operations: creating a bucket, uploading a text file, downloading it, listing objects, and finally deleting both the object and the bucket. It also includes basic error handling for API-specific and generic errors.
Pin the exact version (e.g., `"object-storage-client": "0.2.5"`) in your `package.json` and manually review the project's GitHub releases for breaking changes before upgrading. Consider using a tool like `npm-check-updates` with a conservative update policy.
Ensure your application is configured to interact with a Metorial Object Storage Service instance. If you need a client for a generic S3-compatible service, consider alternatives like `@aws-sdk/client-s3` or `minio`'s client library.
Implement robust `try...catch` blocks that handle both `ObjectStorageError` for API responses and generic `Error` instances for underlying network or connection failures, as demonstrated in the quickstart example.
Ensure you are using `import { ObjectStorageClient } from 'object-storage-client';` in your TypeScript/ESM files. If using CommonJS, consider transpiling your code to ESM or configuring your bundler (e.g., Webpack, Rollup) to correctly handle ESM module resolution for `object-storage-client`.Verify that the bucket name is correct and that the bucket exists before attempting object-level operations. If the bucket should exist, check the server-side logs for unexpected deletion or naming issues.
Ensure the Metorial Object Storage Service is running and accessible from where your client code is executing. Double-check the URL and port provided to the `ObjectStorageClient` constructor. If running in Docker, ensure port mappings are correct.
No dependency data recorded yet.