Options
All
  • Public
  • Public/Protected
  • All
Menu

Class User<TUserStorage>

Type parameters

  • TUserStorage

Hierarchy

  • User

Properties

access

access: Access

Optional email

email: undefined | string

Gets the user profile email. Only retrievable with "Google Sign In" linking type set up for account linking in the console.

See {@link Profile#payload|conv.user.profile.payload} for all the payload properties.

example

// Dialogflow
const app = dialogflow({
  clientId: CLIENT_ID,
})

app.intent('Default Welcome Intent', conv => {
  conv.ask(new SignIn('To get your account details'))
})

// Create a Dialogflow intent with the `actions_intent_SIGN_IN` event
app.intent('Get Signin', (conv, params, signin) => {
  if (signin.status === 'OK') {
    const email = conv.user.email
    conv.ask(`I got your email as ${email}. What do you want to do next?`)
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to next?`)
  }
})

// Actions SDK
const app = actionssdk({
  clientId: CLIENT_ID,
})

app.intent('actions.intent.MAIN', conv => {
  conv.ask(new SignIn('To get your account details'))
})

app.intent('actions.intent.SIGN_IN', (conv, input, signin) => {
  if (signin.status === 'OK') {
    const email = conv.user.email
    conv.ask(`I got your email as ${email}. What do you want to do next?`)
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to next?`)
  }
})

See {@link Profile#payload|conv.user.profile.payload} for all the payload properties.

example

// Dialogflow
const app = dialogflow({
  clientId: CLIENT_ID,
})

app.intent('Default Welcome Intent', conv => {
  conv.ask(new SignIn('To get your account details'))
})

// Create a Dialogflow intent with the `actions_intent_SIGN_IN` event
app.intent('Get Signin', (conv, params, signin) => {
  if (signin.status === 'OK') {
    const email = conv.user.email
    conv.ask(`I got your email as ${email}. What do you want to do next?`)
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to next?`)
  }
})

// Actions SDK
const app = actionssdk({
  clientId: CLIENT_ID,
})

app.intent('actions.intent.MAIN', conv => {
  conv.ask(new SignIn('To get your account details'))
})

app.intent('actions.intent.SIGN_IN', (conv, input, signin) => {
  if (signin.status === 'OK') {
    const email = conv.user.email
    conv.ask(`I got your email as ${email}. What do you want to do next?`)
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to next?`)
  }
})
example

// Dialogflow
const app = dialogflow({
  clientId: CLIENT_ID,
})

app.intent('Default Welcome Intent', conv => {
  conv.ask(new SignIn('To get your account details'))
})

// Create a Dialogflow intent with the `actions_intent_SIGN_IN` event
app.intent('Get Signin', (conv, params, signin) => {
  if (signin.status === 'OK') {
    const email = conv.user.email
    conv.ask(`I got your email as ${email}. What do you want to do next?`)
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to next?`)
  }
})

// Actions SDK
const app = actionssdk({
  clientId: CLIENT_ID,
})

app.intent('actions.intent.MAIN', conv => {
  conv.ask(new SignIn('To get your account details'))
})

app.intent('actions.intent.SIGN_IN', (conv, input, signin) => {
  if (signin.status === 'OK') {
    const email = conv.user.email
    conv.ask(`I got your email as ${email}. What do you want to do next?`)
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to next?`)
  }
})

entitlements

The list of all digital goods that your user purchased from your published Android apps. To enable this feature, see the instructions in the documentation.

last

last: Last

locale

locale: string

The user locale. String represents the regional language information of the user set in their Assistant settings. For example, 'en-US' represents US English.

name

name: Name

User's permissioned name info. Properties will be undefined if not request with conv.ask(new Permission)

permissions

permissions: Api.GoogleActionsV2UserPermissions[]

profile

profile: Profile

raw

storage

storage: TUserStorage

The data persistent across sessions in JSON format. It exists in the same context as conv.user.id

example

// Actions SDK
app.intent('actions.intent.MAIN', conv => {
  conv.user.storage.someProperty = 'someValue'
})

// Dialogflow
app.intent('Default Welcome Intent', conv => {
  conv.user.storage.someProperty = 'someValue'
})
example

// Actions SDK
app.intent('actions.intent.MAIN', conv => {
  conv.user.storage.someProperty = 'someValue'
})

// Dialogflow
app.intent('Default Welcome Intent', conv => {
  conv.user.storage.someProperty = 'someValue'
})

Accessors

id

  • get id(): string
  • set id(value: string): void
  • Random string ID for Google user.

    deprecated

    Use {@link User#storage|conv.user.storage} instead.

    deprecated

    Use {@link User#storage|conv.user.storage} instead.

    Returns string

  • Random string ID for Google user.

    Parameters

    • value: string

    Returns void

Generated using TypeDoc