Create or fork a site on beaker

  1. Home
  2. Knowledge Base
  3. Beaker Browser
  4. Create or fork a site on beaker

The DatArchive API provides three ways to get an archive instance:

  1. Open an existing archive with the DatArchive constructor.
  2. Create a new site with DatArchive.create().
  3. Fork an existing site with DatArchive.fork().

DatArchive

To open an existing archive, use the DatArchive constructor as follows:

snippet

var archive = new DatArchive('dat://…')

DatArchive.create()

To create a new site, use DatArchive.create() as follows:

snippet

var archive = await DatArchive.create({title: '…', description: '…'})

This will result in a modal window which the user will either confirm or deny.

DatArchive.fork()

To fork an existing site, use DatArchive.fork() as follows:

snippet

var archive = await DatArchive.fork('dat://…', {
  title: '…',
  description: '…'
})

This will result in a modal window which the user will either confirm or deny.

A fork will be made of the currently downloaded state. That means, if you want to be sure a full fork is made, you should call download() first.

Facebook Comments

Was this article helpful?

Related Articles