Skip to content

Latest commit

 

History

History

API1.1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

KeyAuth JavaScript Example

Example is Using NON-Encrypted API 1.1, So if you want more security use 1.0 or 1.2 API Example.

Example Codes

Filling KeyAuth Class Constructor
const KeyAuthApp = new KeyAuth(
    '',      // Application Name
    '',     // Application OwnerId
    '',    // Application Secret
    '1.0' // Application Version
);
Initializing Application
await KeyAuthApp.Initialize();

General Features
Login
await KeyAuthApp.login("<USERNAME>", "<PASSWORD>");
Register
await KeyAuthApp.register("<USERNAME>", "<PASSWORD>", "<LICENSE/KEY>", "<OPTIONAL EMAIL>")
Forgot
await KeyAuthApp.forgot("<USERNAME>", "<EMAIL>");
License Login
await KeyAuthApp.license("<LICENSE/KEY>");
Upgrade an Account
await KeyAuthApp.upgrade("<USERNAME>", "<LICENSE/KEY>");

Variables
Get Public Variable
await KeyAuthApp.var("<VarId>");
Get User Variable
await KeyAuthApp.GetVar("<VarId>");
Set User Variable
await KeyAuthApp.SetVar("<VarId>", "<VarData>");

Banning Logged in User
await KeyAuthApp.ban();

File Downloads
await KeyAuthApp.file("<FileId>");

Webhooks
Normal Request with Params
await KeyAuthApp.webhook("<WebId>", "<Params>")
Webhook Request with Body & Content Type
await KeyAuthApp.webhook("<WebId>", "<Params>", "<Body>", "<Content Type>");
Discord Webhook Example
await KeyAuthApp.webhook("<WebId>", "", "{\"content\": \"webhook message here\",\"embeds\": null}", "application/json");

Checks
Check Session Status
await KeyAuthApp.check();
Check Blacklist Status
await KeyAuthApp.checkBlack();
Check / Fetch Online Users
await KeyAuthApp.fetchOnline();

Chats
Get 20 Latest Chat Messages
await KeyAuthApp.ChatGet();
Send Chat Message
await KeyAuthApp.ChatSend("<ChannelName>", "<Message>");

Logs
await KeyAuthApp.log("<Message>");

Additional / Extra Functions

Set/Change Console Title
await KeyAuthApp.setTitle("<NewTitle>");
Sleep is ms(s)
await KeyAuthApp.sleep("<1 sec = 1000ms>")