Skip to content

ReScript WebAPI

ReScript bindings for everything you need in the browser.

NPM Version

Install the package using your favorite package manager:

npm i @rescript/webapi@experimental

and add @rescript/webapi to your rescript.json:

{
"dependencies": [
"@rescript/webapi"
]
}

After installing the package , you can use bindings for the various Web APIs as defined in MDN.

let location = WebAPI.Window.current->WebAPI.Window.location
// Access properties using `.`
let href = location.href
// Invoke methods using the `->TypeModule.method`
location->WebAPI.Location.reload