Use a class as the JavaScript hook