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();
Promise<{token:string|null}>. returns null if there is an error with your apiKey or secretKey.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
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,
});
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
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,
});
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
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,
});