npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

breeze-uploader-sdk

v2.3.9

Published

Breeze Uploader is an SDK that allows you to manage your files in the cloud. It is written in TypeScript and provides a simple and easy-to-use CRUD operations.

Downloads

178

Readme

Breeze Uploader SDK Documentation

[!IMPORTANT]

  • Important Reminder: Before proceeding, ensure you have obtained your API and Secret keys. This is crucial for the successful integration of the service. Click here to get your keys.

Introduction

Breeze Uploader

The Breeze-Uploader-Sdk is a comprehensive toolkit designed to facilitate file operations such as:

  • uploading

  • fetching

  • renaming

  • deleting

    It abstracts complex API calls into simple, easy-to-use methods that can be integrated into any web application (client or server).

This SDK is built to handle various file types, including:

  • images

  • videos

  • generic files

    providing a seamless experience for developers working with file uploads and management

Installation

Installing Remix-Breeze

The SDK can be installed into your project via npm or yarn:

npm i breeze-uploader-sdk
yarn add breeze-uploader-sdk

Getting Started

To begin using the Breeze Uploader SDK, you need to have an API key provided by Breeze. This key is essential for authenticating your requests and interacting with the Breeze file management system. Get your Api Key now for free

Initialization

To use the SDK, you must first import and initialize it with your API and secret key:

import { BreezeUploader } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

Client side Upload

Before using the client-side upload feature, you must first obtain a oneTimeToken from the server.

  • Here is how to get the oneTimeToken from the server:

    import { BreezeUploader } from "breeze-uploader-sdk";
    
    const breeze = new BreezeUploader({
      apiKey: "YOUR_API_KEY",
      secretKey: "YOUR_SECRET_KEY",
    });
    const { token } = await breeze.getOneTimeToken();
    • Returns
      • A Promise<{token:string|null}>. returns null if there is an error with your apiKey or secretKey.

Upload Images

Uploads a collection of image files.

  • Arguments

    • images: An array of File objects representing the images to be uploaded.
    • oneTimeToken: The token you get from the server.
    • maxSize (optional): The maximum files size allowed.
    • maxFileCount (optional): The maximum number of images allowed to be uploaded in a single operation.
  • Returns

    • A Promise<{ files:BreezeFileType[]; error:string|null }> that resolves to an object containing information about the upload process, including completion and error details.
import { BreezeClientUploader, BreezeFileType } from "breeze-uploader-sdk";

const breeze = new BreezeClientUploader();

await breeze.uploadImages({
  images: Array.from(files),
  oneTimeToken,
});

uploadVideos

Uploads a collection of video files.

  • Arguments

    • videos: An array of File objects representing the videos to be uploaded.
    • oneTimeToken: The token you get from the server.
    • maxSize (optional): The maximum files size allowed.
    • maxFileCount (optional): The maximum number of videos allowed to be uploaded in a single operation.
  • Returns

    • A Promise<{ files:BreezeFileType[]; error:string|null }> that resolves to an object containing information about the upload process, including completion and error details.
import { BreezeClientUploader, BreezeFileType } from "breeze-uploader-sdk";

const breeze = new BreezeClientUploader();

await breeze.uploadVideos({
  videos: Array.from(files),
  oneTimeToken,
});

uploadAnyFiles

Uploads a collection of files of any type.

  • Arguments

    • files: An array of File objects representing the files to be uploaded.
    • oneTimeToken: The token you get from the server.
    • maxSize (optional): The maximum files size allowed.
    • maxFileCount (optional): The maximum number of files allowed to be uploaded in a single operation.
  • Returns

    • A Promise<{ files:BreezeFileType[]; error:string|null }> that resolves to an object containing information about the upload process, including completion and error details.
import { BreezeClientUploader, BreezeFileType } from "breeze-uploader-sdk";

const breeze = new BreezeClientUploader();

await breeze.uploadAnyFiles({
  files: Array.from(files),
  oneTimeToken,
});

Server side Upload

Upload Images

Uploads a collection of image files.

  • Arguments

    • images: An array of File objects representing the images to be uploaded.
    • maxSize (optional): The maximum files size allowed.
    • maxFileCount (optional): The maximum number of images allowed to be uploaded in a single operation.
  • Returns

    • A Promise<{ files:BreezeFileType[]; error:string|null }> that resolves to an object containing information about the upload process, including completion and error details.
import { BreezeUploader, BreezeFileType } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

await breeze.uploadImages({ images: Array.from(files) });

uploadVideos

Uploads a collection of video files.

  • Arguments

    • videos: An array of File objects representing the videos to be uploaded.
    • maxSize (optional): The maximum files size allowed.
    • maxFileCount (optional): The maximum number of videos allowed to be uploaded in a single operation.
  • Returns

    • A Promise<{ files:BreezeFileType[]; error:string|null }> that resolves to an object containing information about the upload process, including completion and error details.
import { BreezeUploader, BreezeFileType } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

await breeze.uploadVideos({ videos: Array.from(files) });

uploadAnyFiles

Uploads a collection of files of any type.

  • Arguments

    • files: An array of File objects representing the files to be uploaded.
    • maxSize (optional): The maximum files size allowed.
    • maxFileCount (optional): The maximum number of files allowed to be uploaded in a single operation.
  • Returns

    • A Promise<{ files:BreezeFileType[]; error:string|null }> that resolves to an object containing information about the upload process, including completion and error details.
import { BreezeUploader, BreezeFileType } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

await breeze.uploadAnyFiles({ files: Array.from(files) });

GetFileByKey

Retrieves a file details by its unique key.

  • Arguments

    • key: The unique key of the file to retrieve.
  • Returns

    • A Promise<BreezeFileType> Promise that resolves to the file's details or null if the file cannot be found.
import { BreezeUploader } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

await breeze.getFileByKey({ key: "YOUR_FILE_KEY" });

GetAllFIles

Retrieves all files within a specified bucket.

  • Arguments

    • bucketName: The name of the bucket from which to retrieve files.
    • limit (optional): The maximum number of files to retrieve.
    • skip (optional): The number of files to skip (for pagination).
  • Returns

    • An array Promise<{ files:BreezeFileType[];fileCount:number; totalPages:number}> that resolves to an object containing the list of files and the total file count.
import { BreezeUploader } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

await breeze.getAllFiles({ bucketName: "YOUR_BUCKET_NAME" });

renameFile

Renames a specified file.

  • Arguments

    • key: The unique key of the file to rename.
    • name: The new name for the file.
  • Returns

    • A Promise<BreezeFileType|null> that resolves to the renamed file's details or null if the operation fails.
import { BreezeUploader } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

await breeze.renameFile({ key: "YOUR_FILE_KEY", name: "NEW_NAME" });

deleteFileList

Deletes a list of files specified by their keys.

  • Arguments

    • keys: An array of strings representing the keys of the files to delete.
  • Returns

    • A Promise<{deletedCount:number}> that resolves to an object containing the count of deleted files.
import { BreezeUploader } from "breeze-uploader-sdk";

const breeze = new BreezeUploader({
  apiKey: "YOUR_API_KEY",
  secretKey: "YOUR_SECRET_KEY",
});

await breeze.deleteFileList({ keys: ["YOUR_KEY",...] });