---
title: "In-App Data"
author: "NEST CoreDev"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{In-App Data}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

## Building data in the App

Typically the data that is passed into a `teal` application is available before the app is run.
However, this is not always true and in some cases the data will be built only after the app has started.
A good example is pulling the data from an external repository, like a database, or uploading a file.
Additional authentication may be required.

### `teal_data_module`

Preprocessing actions can be performed in-app using the `teal_data_module`.
Rather than passing a `teal_data` object to the app, one may pass a _`shiny` module_ that _returns_ a `teal_data` object (wrapped in a reactive expression).
This allows the app developer to include user actions data creation, fetching, and even pre-filtering modification.

## Further reading

A complete explanation of using the `teal_data_module` can be found in [this `teal` vignette](../data-as-shiny-module.html)
