Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

add middleware layer support #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

r-nasiri
Copy link

No description provided.

@mattcarrollcode
Copy link
Contributor

Thanks for the contribution. Can you tell me a little bit more about the use case for this middleware?

@r-nasiri
Copy link
Author

r-nasiri commented Nov 12, 2018

the middleware layer is a set of functions that will run before each intent handler and can be used for different reasons. e.g. you can have a function that does authentication for you and instead of calling it in each intent handler, you can define it as a middleware function. It can also be used to extent the agent functionality. e.g. you can create helper functions in the middleware function and assign them to the agent and use the new functions in the intent handlers. I think someone here was looking for a way to extract user id based on different platforms and having a middleware layer will let them write their own functions to extract the id and then assign it to the agent.
this was also discussed in issue #143 and #169

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants