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.
Filling KeyAuth Class Constructor
const KeyAuthApp = new KeyAuth (
'' , // Application Name
'' , // Application OwnerId
'' , // Application Secret
'1.0' // Application Version
) ;
await KeyAuthApp . Initialize ( ) ;
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 . file ( "<FileId>" ) ;
Normal Request with Params
await KeyAuthApp . webhook ( "<WebId>" , "<Params>" )
Webhook Request with Body & Content Type
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 ( ) ;
Check / Fetch Online Users
await KeyAuthApp . fetchOnline ( ) ;
Get 20 Latest Chat Messages
await KeyAuthApp . ChatGet ( ) ;
await KeyAuthApp . ChatSend ( "<ChannelName>" , "<Message>" ) ;
await KeyAuthApp . log ( "<Message>" ) ;
Additional / Extra Functions
await KeyAuthApp . setTitle ( "<NewTitle>" ) ;
await KeyAuthApp . sleep ( "<1 sec = 1000ms>" )