As above, we should ideally do this via a JavaScript API.