Local Database
The Local Database (Local DB) is a powerful feature on Coast that keeps track of all the state running on every demo instance. The Local DB allows you to reference variables and update data dynamically throughout the demo (in text, subsequent requests, image URLs, etc.). Coast's Local DB is refreshed on every demo session.
By default, any collected input tied to a request as well as all response data are automatically saved to the Local DB. Every step and tab in the demo has randomly-generated slugs associated with them (which can be changed), and the Local Database makes it possible to reference these values throughout the demo.
In order to view (or change) a tab's associated database key, hit the gear icon, while in the Editor
. The value in DB Key
is the name of the key that will contain all the data relating to this tab.

Pro Tip: change your tab DB keys to more relevant values to avoid confusion when accessing the Local Database.
In order to reference a value in the Local DB, you can use double brackets {{ }}
throughout the builder.
- You can query a database value by a direct path like
{{ purpleDemo.response.age }}
, - Or, you can both query and apply a custom script simultaneously by adding
this.db.
as a prefix. For example, to access the a database value stored atpurpleDemo.response.age
and add 22, it would look like:{{ this.db.purpleDemo.response.age + 22 }}
What's up with this.db
? Read up here to learn about
writing custom JavaScript in the Coast Builder.
Prospect Data
The Local DB automatically stores some data pertaining to your prospect. This allows you to define variables that will be personalized for each demo. This data includes:
- Company name
- Logo
- Domain
- Color
- Font color
- Industry tag
Use the Local Database to make your demos feel more customized and engaging.
All the data stored on your prospect is located in theinstance.prospectDetails
pathway. Try adding {{ instance.prospectDetails.companyName }}
and watch what happens 🪄.
Note that in the builder, we have set the default prospect to be Airbnb. Anytime you see anything related to Airbnb in the builder (name, color, logos etc.), this data will be updated to match your prospect's data.
Finding Local DB Values
The Builder features a fast, searchable and navigable sidebar, which can be accessed on the left panel of the builder. Here, you can quickly find and reference the values you need. Easily traverse the Local DB by clicking through this sidebar. By clicking on a value on this sidebar, Coast will automatically copy its path to your clipboard, and you will receive an alert in the bottom right of your screen.

Red vales indicate that the value is numerical, whereas blue values signify text. White values on this panel are simply objects that may contain child values
Writing to the Local Database
If you wish to manually save a user input that is not tied to a request, you can do so on the right panel, under the Save Input Value
dropdown menu. By checking off Enable Save
box and defining a Database Key
, any user input will be saved to the Local DB in real time.

If you wish to have a value loaded into the Local Database by default, you can make use of either the Load Script, or Customization Items. Customization Items should be used if you want this value to change on a per-demo basis, whereas Load Script can be used for static global variables across all demos.
Additionally, you are able to write to the Local Database in any JavaScript code in a demo. This is useful for when you want to save data returned in a Custom Code Block to the Local Database. In order to save a value to the database, simply use the window?.parent?.modDb("keyName", value)
function.
As an example, window?.parent?.modDb("token_value", token)
will save the value of token
to the Local Database under the key token_value
. For a full list of the window functions available, check out the JavaScript in Coast section.