1.0.5 • Published 1 year ago

@rbxts/firebase-rtdb v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

@rbxts/firebase-rtdb

roblox-ts typings for RBLX-Firebase for Firebase's RealTime DataBase

Example Usage

import FirebaseService from "@rbxts/firebase-rtdb"
const Firebase = FirebaseService("YOUR DB URL", "YOUR AUTH KEY");

const BansData = Firebase.GetFirebase("Bans"); // Gets the Firebase at the directory "Bans"
const [banSuccess] = BansData.SetAsync("Player_UID", true); // sets the key "Player_UID" to the value true (returns true if successful)
const isBanned = BansData.GetAsync("Player_UID"); // gets the value at key "Player_UID" (in this case it will return true)
const [unbanSuccess] = BansData.DeleteAsync("Player_UID"); // deletes the key "Player_UID" from the datastore (returns true if successful)

// example for unbanning key if math.random() >= 0.5
BansData.UpdateAsync("Player_UID", (old) => {
    if (old !== true) return old;
    if (math.random() < 0.5) return old;
    
    return undefined;
});
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago