a00.js
Usage

Usage

a00.js has 3 main methods. First, you need to initialize the A00 class with the API key.

You can get your API key from a00.app Settings (opens in a new tab).

import { A00 } from "a00.js";
 
const a00 = new A00("YOUR_API_KEY")

Uploading files

upload method returns the uploaded file's CID.

// Returns a CID, which is needed for deleting & downloading files in future
const file = await a00.upload("./path/to/file");

Downloading files

const content = await a00.get(file);

Then you can save the file

fs.writeFileSync(`./${file}.txt`, content);

Deleting files

a00.delete(file);