NebStore SDK bucket operations

This reference page lists all operations you can do to manage your storage buckets with Nebula.


Create bucket

Creates a bucket in the project that the API key belongs to.

Sample

const newBucket = {
  bucketName: 'my-new-bucket',
  region: 'sa-1',
  isPrivate: true,
}
const response = await nebStore.createBucket(newBucket)
console.log(response)
AttributeFormatRequired?Desription
bucketNamestringrequiredCreate a bucket using this bucket name. Check out the bucket naming conventions here.
regionstringrequiredCreate a bucket in this hosting region. Possible value: sa-1.
isPrivatebooleanoptionalSet to false if you want to allow public access to the objects in this bucket. Defaults to true.

Get bucket

Retrieves details about a bucket based on its name.

Sample

const response = await nebStore.getBucket('bucketName')
console.log(response)
AttributeFormatRequired?Desription
bucketNamestringrequiredThe name of the bucket you want to retrieve.

List buckets

Lists details about all buckets in the project that the API key belongs to. The results can be paginated. The results can also be filtered using startDate and endDate which are based on the creation date of your buckets.

Sample

const params = {
  page: 1,
  limit: 10,
  startDate: new Date('2024-10-15'),
  endDate: new Date('2024-10-20'),
}

const response = await nebStore.listBuckets(params)
console.log(response)
AttributeFormatRequired?Desription
pagenumberoptionalJump to a specific page of results.
limitnumberoptionalLimit the number of items on a result page.
startDatestringoptionalThe starting date for filtering buckets based on the date they were created. This attribute accepts ISO 8601 dates in YYYY-MM-DD format.
endDatestringoptionalThe ending date for filtering buckets based on the date they were created. This attribute accepts ISO 8601 dates in YYYY-MM-DD format.

Empty bucket

Removes all objects from a bucket. This is required before you can delete the bucket.

Sample

const response = await nebStore.emptyBucket('bucketName')
console.log(response)
AttributeFormatRequired?Desription
bucketNamestringrequiredThe name of the bucket you want to empty.

Delete bucket

Deletes a bucket. Only empty buckets can be deleted.

Sample

const response = await nebStore.deleteBucket('bucketName')
console.log(response)
AttributeFormatRequired?Desription
bucketNamestringrequiredThe name of the bucket you want to delete.

Need help?

If you have any technical questions or bump into any problems, get in touch with our Support team! We are here to help, and welcome any feedback you might have about NebStore.