1.7.6 • Published 3 years ago

express-udb v1.7.6

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

app.get('/home',(req,res,next)=>{ if(udb.ifLogedIn() === true){//if user is loged in (also authenticates) udb.Authenticate({//Authenticate user success:function(){//if authetication ok res.sendFile(__dirname+'/html/home.html')//send home page }, err:function(){//if authetication not ok res.redirect('/login')//take to login } }) }else{//if user not loged in res.redirect('/login')//take user to login page } }) server.listen(8080)//start server

// changeing this user data $.udb.ChangeUser.name("new name",()=>{//changes this user user name //do something when done }) $.udb.ChangeUser.status("new status",()=>{//changes this user status //do something when done }) $.udb.ChangeUser.profilePhoto("new profile photo url",()=>{//changes this user profile photo url //do something when done }) $.udb.ChangeUser.settings({somerandomething:"blahblah"},()=>{//changes user settings, this is a json array for user settings //do something when done })

//get other user data $.udb.GetClientUserData("userid",(clientdata)=>{//gets other client data console.log(clientdata)//logs client data array })

//handeling Contacts $.udb.addContact('userid',(result)=>{ // add contact, result will be true if ok, false if user doesnt exist }) $.udb.removeContact('userid',(result)=>{ // add remove, result will be true if ok, false if user doesnt exist }) $.udb.blockContact('userid',(result)=>{ //blockes contact to send inbox, message and online data,result will be true if ok and false if user does not exist })

$.udb.unblockContact('userid',(result)=>{ //unblockes contact to send inbox, message and online data,result will be true if ok and false if user does not exist })

//chating usage $.udb.sendMessage("userid","message content",()=>{ //do something when done }) $.udb.getChatData("userid",(chatdata)=>{ //returns chatdata with user in array form /example { to:"who the message is too", from:"who the message is from", content:"the message content"
}
/ }) //LIVE FUNCTIONS //emit that user is online $.udb.live.emitOnline()

// active listen for functions $.udb.live.active({ onOnline:(id)=>{//if user goes online do something with id

}, onOffline:(id)=>{//if user goes offline do something with id

}, onMessage:(data)=>{//if this user gets message, message returns the same way a chat message does

}, })

//enable authetication loop example function autoReAuthenticateUser(){ setTimeout(()=>{ $.udb.authUpdate(()=>{//command for re establishing authtoken autoReAuthenticateUser()//recall })},4100000)// 7:50 timeout for reauth } autoReAuthenticateUser()

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.9

3 years ago

1.6.8

3 years ago

1.6.7

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.9

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago