Setup
The client sets up Bare Mux, transports, a service work, and core Chemical functions.
Installation
To install the client script, add it to the head of your website.
<head>
<script src="/chemical.js"></script>
</head>
Wisp
You can change the default Wisp server with the data-wisp
attribute. It is highly recommended to host your own Wisp server.
<script data-wisp="wss://example.com/wisp/" src="/chemical.js"></script>
Transport
You can change the default transport with the data-transport
attribute. Use libcurl
or epoxy
.
<script data-transport="epoxy" src="/chemical.js"></script>
Store
Use the data-wisp-store
and data-transport-store
attributes to use Chemical store. Once set, values will be saved for when you revisit the site. Set the store using setStore.
<script data-wisp-store src="/chemical.js"></script>
chemical.setStore("transport", "epoxy")