Storage

Buckets

Organize and manage your files effectively with Nuvix Storage Buckets. Explore how to create, configure, and use storage buckets for seamless file organization.

Storage buckets are a group of files, similar to tables in Nuvix Databases. Buckets let you limit file size and extensions, whether or not to encrypt the files, and more.

Create Bucket

You can create your bucket from the Nuvix Console, a Server SDK, or the CLI.

You can create a bucket by heading to the Storage page and clicking Create bucket.

Create bucket on console

You can also create tables programmatically using a Server SDK. Nuvix Server SDKs require an API key.

import { Client, ID } from '@nuvix/client';

// Init SDK
const nx = new Client()
    .setEndpoint('https://api.nuvix.in/v1') // Your API Endpoint
    .setProject('<PROJECT_ID>') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key

const bucket = await nx.storage.createBucket({
    bucketId: ID.unique(),
    name: '<NAME>'
});

console.log(bucket);
import { Client, ID } from "npm:nuvix";

// Init SDK
const nx = new Client()
    .setEndpoint('https://api.nuvix.in/v1') // Your API Endpoint
    .setProject('<PROJECT_ID>') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key


const bucket = await nx.storage.createBucket({
    bucketId: ID.unique(),
    name: '<NAME>'
});

console.log(bucket);

You can also configure permission, file size and extension restrictions, and more in the createBucket method, learn more about the createBucket in the API references.

Create a bucket using the CLI command nuvix init buckets.

nuvix init buckets

This will initialize your bucket in your nuvix.config.json file. To push your initialized bucket, use the nuvix push buckets.

nuvix push buckets

How is this guide?

Last updated on

On this page

Buckets