- Chat module is not available right now. I will update it soon
- To install FusionAPI
npm
package you just need to run the following command in your terminal:
- Here is a list of all the modules and code examples:
App.ValidateSession()
-> Check if a session is active.
App.Has2FA(username)
-> Checks if a user has 2FA enabled.
App.GetAppVars()
-> Fetches application variables.
App.SetUserVars(key, value)
-> Set user variables.
App.GetIP()
-> Get visitor IP
App.Login(username, password)
-> Login
App.Register(username, password, token)
-> Register users to your application.
App.ResetPassword(oldpassword, newpassword)
-> Reset your password
App.MyBlob()
-> Returns a blob of user data.
App.AppBlob()
-> Fetch all relevant data on an app.
App.MyVars()
-> Grabs user variables.
const { FusionApp } = require("fusionapi")
var App = new FusionApp("APPID")
App.Login("username", "Password123/").then(loginResponse => {
if(loginResponse.error == false){
console.log(loginResponse.message);
}else{
console.log(loginResponse.message);
}
})
const { FusionApp } = require("fusionapi")
var App = new FusionApp("APPID")
App.Register("username", "Password123/", "TOKEN").then(registerResponse => {
if(registerResponse.error == false){
console.log(registerResponse.message);
}else{
console.log(registerResponse.message);
}
})
App.Login("username", "Password123/").then(data => {
if(loginResponse.error == false){
App.ResetPassword("myOldPassword", "myNewPassword").then(resetResponse => {
if(resetResponse.error == false){
console.log(resetResponse.vars);
}else{
console.log(resetResponse.message);
}
})
}else{
console.log(loginResponse.message);
}
})
const { FusionApp } = require("fusionapi")
var App = new FusionApp("APPID")
App.Has2FA("username").then(h2faResponse => {
if(h2faResponse.error == false){
console.log(h2faResponse.status);
}else{
console.log(h2faResponse.message);
}
})
const { FusionApp } = require("fusionapi")
var App = new FusionApp("APPID")
App.Login("username", "Password123/").then(loginResponse => {
if(loginResponse.error == false){
App.GetAppVars().then(appVars => {
if(appVars.error == false){
console.log(appVars.vars);
}else{
console.log(appVars.message);
}
})
}else{
console.log(loginResponse.message);
}
})
const { FusionApp } = require("fusionapi")
var App = new FusionApp("APPID")
App.Login("username", "Password123/").then(loginResponse => {
if(loginResponse.error == false){
App.SetUserVars("varName", "varValue").then(userVarResponse => {
console.log(userVarResponse);
})
}else{
console.log(loginResponse.message);
}
})
const { FusionApp } = require("fusionapi")
var App = new FusionApp("APPID")
App.Login("username", "Password123/").then(loginResponse => {
if(loginResponse.error == false){
App.MyVars("varName", "varValue").then(userVarResponse => {
console.log(userVarResponse);
})
}else{
console.log(loginResponse.message);
}
})