TapUp Wrapper Client
A simple client for uploading files to Google Cloud Storage via a custom wrapper API.
Installation
npm install gcs-wrapper-client
Setup
-
Create a .env
file in your project root:
TAPUP_API_KEY=your_api_key
-
Initialize the package in your code:
import { initWrapper } from "gcs-wrapper-client";
const uploader = initWrapper();
Usage
Upload a File
const file = new Blob(["Hello, world!"], { type: "text/plain" });
const fileName = "example.txt";
uploader
.uploadFile(file, fileName)
.then((result) => {
if (result.success) {
console.log("File uploaded successfully:", result.fileUrl);
} else {
console.error("Upload failed:", result.message);
}
});