CyberSiARA™ | Node js

Node js Integration Guideline

1. Get your public & private key from mycybersiara.com

2. Install package from npm

npm i siarashield

3. Import siarashield from packages.

const siarashield = require("siarashield")

4. Add below code for token validation in your file and change "PRIVATE-KEY" with your private key

siarashield.validate("PRIVATE-KEY", TOKEN, function (response, error){
     if(error) return console.error(error);
      console.log
(response);
       // Write your code here based on messages

     if(response.Message==="Verified")   {

       // write code here

   }
)

5. Once all these steps are done, go to your browser and refresh the page and enjoy the SiaraShield. Thank you for using SiaraShield!

1. Create method for initialized captcha on load.

        <script>
            export default{
                    name:'PageName',
                    components:{...},
                    mounted() {this.mycybersiara()},
                    methods(){
                            mycybersiara(){
                            var PublicKey = 'TEST-CYBERSIARA';
                         InitCaptcha('PublicKey');
                         $('.CaptchaSubmit').click(function (){
                    if(CheckCaptcha()){
                axios.get('https://embed.mycybersiara.com/api/validate-token',{
                    headers:{ key: 'TEST-CYBERSIARA', Authorization: `Bearer ${CyberSiaraToken}' }
                             }).then((res) =>{
                    // Please write your submit button click event function here //
                            })
                    }
                            });
                        }
                    }...
                }
                                
</script>