Client - side code for JS-Sark