@digicroz/filestore-server
v1.0.7
Published
Server-side SDK for DC FileStore — provides methods for file upload, download, and management
Maintainers
Readme
@digicroz/filestore-server
A server-side SDK for DC FileStore, enabling seamless file upload, download, and management operations.
Features
- Server-to-server file operations
- TypeScript support
- TRPC integration
- ESM compatible
Installation
npm install @digicroz/filestore-serverPrerequisites
- Node.js >= 16.0.0
- Access token from DC FileStore (see below)
Usage
Import and initialize the client:
import { createFileStoreClient } from "@digicroz/filestore-server"
// Initialize the client with environment
const client = createFileStoreClient("production_remote")Available Methods
getPathInfo(path: string): Retrieves information about a specified path.getFileInfo(fileId: string): Gets details about a specific file.requestUploadUrl(params): Requests a pre-signed URL for file upload.confirmUpload(params): Confirms the successful upload of a file.deleteFile(fileId: string): Deletes a file from the store.
Getting an Access Token
To obtain an access token:
- Visit https://filestore.digicroz.com/
- Create a Digicroz account if needed at https://accounts.digicroz.com
- Create a bucket and a base-level directory.
- Navigate to the buckets page and click Access Tokens.
- Generate a token using your directory ID and key name.
Important: The token is displayed only once. Save it securely.
Environments
development_local: For local developmentdevelopment_remote: For remote developmentproduction_remote: For production use
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
MIT License - see LICENSE for details.
