> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Artifacts

> Web pages with their own database, created and read from your program.

An [artifact](/en/guides/artifacts) is just another document: a web page that stores data. Your program creates it, asks
for a link to show it, and reads what people have saved in it.

```ts theme={null}
// 1. Create it: from a sentence, or with your content in Markdown (content.markdown)
const doc = await doconda.documents.create({
  format: "artifact",
  prompt: "A poll to choose Friday's menu, with live results",
})

// 2. A link for your users (here, valid for 1 day)
const [page] = await doconda.documents.outputs(doc.id, { expiresIn: 86_400 })
console.log(page.url) // put it in an <iframe>

// 3. What they have saved
console.log(await doconda.documents.data(doc.id)) // [{ collection: "votes", records: 42 }]
const votes = await doconda.documents.data(doc.id, "votes") // [{ key, data, updated_at }]
```

The page stores its data with `window.doconda.db`: it is explained in the [artifacts guide](/en/guides/artifacts).

## Data only in the browser

With `storage: "local"`, each visitor stores their data in their own browser and Doconda never receives it (so `data`
has nothing to return):

```ts theme={null}
await doconda.documents.create({
  format: "artifact",
  prompt: "A mortgage calculator that remembers my simulations",
  artifact: { storage: "local" },
})
```

In a project that does not store content it is the only mode, and the page arrives as a file to download:
`doconda.documents.download(doc.id, "html")`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.