[Docs] Data | Jovo Framework


#1

Learn more about different data types that can be used in a Jovo project.

Learn more about sessions and the request & response lifecycle here.


This is a companion discussion topic for the original entry at https://www.jovo.tech/docs/data

#2

How to correctly use app data?
I’d like to load data form a json file, or potentially from Firestore - can I do it from outside the app.setHandler ? Or does it have to be triggered with the intent, ie. LAUNCH intent?


#3

Why there is no replied for MarekMis ?
I tired to use npm global , localStorage packages with no use.


#4

Hi @engmg2011, could you further explain what you’re trying to achieve and what goes wrong?


#5

I need to use a lot of variables globally between states and intents. So I thought of using this.$session.$data for all the variables instead of using global declaration.

The question may sound very naive but will it make my responses slower, as the lookup time may increase for this.$session.$data ?


#6

Highly recommended! The problem of global variables is that they are not user-specific. So if you write into a global variable for one user, and the next request is coming from another user, it will use that global variable. I recommend to always use session or database data for stuff like this

At the beginning of each request, the incoming JSON will be parsed and the session data (in Alexa, session attributes) are stored into the this.$session.$data object. Accessing that data object takes as long as accessing any other (e.g. global) variable in your code.