Api key java script code

what does this javascript code do?

<script type="text/javascript">setKey('{{ApiKey}}','{{Name}}');</script>

Hi @2019mcb1228,

In setKey function takes API key and device id as p. ApiKey and Name will be auto initialized by bolt cloud.

setKey('{{ApiKey}}','{{Name}}');

If you open the file https://cloud.boltiot.com/static/js/boltCommands.js , you will find the definition of setKey function.

function setKey(key,dev_name){
    api_key = key;
    d_name = dev_name;
}

Do let me know in case you need any other information.

1 Like

Basically does it help bolt cloud to give a particular Id to our device and authorized the use of bolt cloud API?

@2019mcb1228,

Yes, you can not control someone else’s devices on Bolt Cloud Page. It helps in identifying the owner of the device.

Do let me know in case you need any other information.