const KeyAuthApp = new KeyAuth(
'', // Application Name
'', // Application OwnerId
'', // Application Secret
'1.0' // Application Version
);
await KeyAuthApp.Initialize();
NOTE: For each of these following functions, you can use a try/catch block to catch errors as login error
try {
const result = await keyAuthApp.login(username, password);
} catch (error) {
console.log("Login error: ", error); // Example: Invalid username or password
}
await KeyAuthApp.login("<USERNAME>", "<PASSWORD>");
await KeyAuthApp.register("<USERNAME>", "<PASSWORD>", "<LICENSE/KEY>", "<OPTIONAL EMAIL>")
await KeyAuthApp.forgot("<USERNAME>", "<EMAIL>");
await KeyAuthApp.license("<LICENSE/KEY>");
await KeyAuthApp.upgrade("<USERNAME>", "<LICENSE/KEY>");
await KeyAuthApp.var("<VarId>");
await KeyAuthApp.GetVar("<VarId>");
await KeyAuthApp.SetVar("<VarId>", "<VarData>");
await KeyAuthApp.ban();
await KeyAuthApp.file("<FileId>");
await KeyAuthApp.webhook("<WebId>", "<Params>")
await KeyAuthApp.webhook("<WebId>", "<Params>", "<Body>", "<Content Type>");
await KeyAuthApp.webhook("<WebId>", "", "{\"content\": \"webhook message here\",\"embeds\": null}", "application/json");
await KeyAuthApp.check();
await KeyAuthApp.checkBlack();
await KeyAuthApp.fetchOnline();
await KeyAuthApp.ChatGet();
await KeyAuthApp.ChatSend("<ChannelName>", "<Message>");
await KeyAuthApp.log("<Message>");
await KeyAuthApp.setTitle("<NewTitle>");
await KeyAuthApp.sleep("<1 sec = 1000ms>")