You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

futurebasejs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

futurebasejs

A custom React hook for interacting with Futurebase

0.0.1
latest
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

FutureBaseJS SDK

The FutureBaseJS SDK provides a simple interface to interact with the FutureBase API for managing collections and documents.

Installation

Install the package using npm:

npm install futurebasejs

Usage

Import and initialize the FutureBase class with your credentials:

import FutureBase from "futurebasejs";

const futureBase = new FutureBase({
  username: "your-username",
  password: "your-password",
  projectId: "your-project-id",
});

Methods

allCollections()

Fetch all collections for the authenticated user.

const response = await futureBase.allCollections();
console.log(response);

allDocuments(collectionId: string)

Fetch all documents from a specific collection.

const response = await futureBase.allDocuments("collection-id");
console.log(response);

insertDocument(collectionId: string, data: object)

Insert a new document into a collection.

const response = await futureBase.insertDocument("collection-id", { key: "value" });
console.log(response);

updateDocument(collectionId: string, data: object)

Update an existing document in a collection.

const response = await futureBase.updateDocument("collection-id", { key: "new-value" });
console.log(response);

deleteDocument(collectionId: string, filter: object)

Delete a document from a collection based on a filter.

const response = await futureBase.deleteDocument("collection-id", { key: "value" });
console.log(response);

Response Format

All methods return a FutureResponse object:

interface FutureResponse {
  status: "success" | "error";
  message: string;
  data?: any;
  error?: string;
}

License

This project is licensed under the MIT License.

Keywords

react

FAQs

Package last updated on 09 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts