Documentation / /
Guides

Using experimental APIs

Beaker provides several experimental APIs for building applications. These APIs are still in development and are not stable.

Beaker exposes experimental APIs under experimental.*:

experimental.datPeers.broadcast({hello: 'world'})
experimental.library.list({isSaved: true})
experimental.globalFetch('dat://beakerbrowser.com')
experimental.capturePage('dat://beakerbrowser.com')

Opting-in with dat.json

Because experimental APIs are not stable and can change at any time, Beaker requires you to opt-in explicitly in order to use them in your website or application. To opt-in to using an experimental API, edit your dat.json to indicate which APIs you’d like to use:

dat.json
{
  "experimental": {
    "apis": ["datPeers", "globalFetch", "capturePage", "library"]
  }
}

Available APIs

How stable are experimental APIs?

Experimental APIs are not stable. You should expect all experimental APIs to change or even be removed. You should expect the following changes:

  • Modifications. Lab APIs will change as we learn more about how they work.
  • Deprecations. Lab APIs may be removed in favor of alternatives.
  • Stabilizations. Lab APIs may simply be accepted as stable Web APIs, at which point they will no longer be exposed on the experimental.* object.

The Beaker team will do its best to minimize the impact of changes and to keep you informed about changes when they occur.

Further reading