Skip to content

Wikipedia search

The user types a term and a custom component searches it with the Wikipedia API. With waitAction: true, the conversation waits until the component calls triggerNextStep. See Custom components for more.

  • WikipediaResult reads the term from previousStep.value, the user step rendered right before it.
  • While the request runs, it renders the Loading component exported by react-simple-chatbot, the same dots the bot shows while typing.
  • When the request ends, it calls triggerNextStep() and the chatbot asks to search again.
  • The origin=* parameter makes the Wikipedia API accept requests from any site.