JS API for recording