The request object has an instance for user and session. Both are similar that you can read and write data to and from them.

The authorization is handled automatically by GI in src/Server/client.js.

A user can have many sessions, and a session always belongs to a user. This means if you’re building an assistant with hardware you could identify the user from two different rooms and identify both of those sessions to one person.

Both user and session have a common interface to get and set data.

//Get data

//Get data with dot-path notation

//Set data
request.user.set('profile.age', 34);

//Check if key exists

//Remove a key

Where am I?
I don't know, what city are you from?
I'm from London
I've heard London is nice
Where am I?
You told me you was in London
What's the weather?
Currently 5c, Clear in London
What's the time?
8:29 am, Sunday 11th (GMT+00:00) in London


Example using has, set and get. The result will be stored to the user session which can be used for WeatherIntent and TimezoneIntent parameter slotfilling.

module.exports = class UserFromIntent extends Intent {

  setup() {
      'where am I?'

  response(request) {
    if(request.user.has('city')) {
      return 'You told me you was in '+request.user.get('city');

      action: 'reply',
      entity: 'App.Common.Entity.City',
      force: true

    return 'I don\'t know, what city are you from?';

  reply(request) {
    let city = request.parameters.value('expects');

    request.user.set('city', city);

    return 'I\'ve heard '+city+' is nice'