new js client code