> For the complete documentation index, see [llms.txt](https://docs.newbot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.newbot.io/use-newbot-framework-js/untitled/use-dialogflow.md).

# Use DialogFlow

1. Install the `newbot-dialogflow` module

`npm install newbot-dialogflow`

1. Import the module into the skill and add it to the property `skills`

```javascript
import dialogflowSkill from 'newbot-dialogflow'
import code from './main.converse'

export default {
    code,
    skills: {
        dialogflow: dialogflowSkill({
            projectId: 'newagent-1-c9b25',  // https://dialogflow.com/docs/agents#settings,
            sessionId: 'quickstart-session-id',
            languageDefault: 'en-EN', // optionnal
            credentials: 'PATH_TO_JSON_FILE' // https://cloud.google.com/docs/authentication/production
        })
    }
}
```

### Use in ConverseScript

#### Obtain an answer according to the intention

```typescript
@Intent('input.welcome')  // action name
welcome() {
    > { :intent.response  } // response
}
```

#### Retrieve the entities

```typescript
@Intent('input.welcome')  // action name
welcome() {
    > Hey { :intent.firstname.value  } // display parameter "firstname"
}
```
