The manual/tutorial says it is not supported by default. :(
construct.net/en
But I can not help you with the other JS code problem, sorry.
PS: Did you manage to use clay.io with CocoonJS? It does not work in my game. All clay.io actions (achievements, login..) are not working. :(