add js infrastructure and make url optional