Help forum

Help on Toast

  • Sakamoto

    1 year ago

    I need some help with setting up toast messages after an API call. I'm using Spark Core but I'm having trouble understanding the documentation for this specific feature.

    Has anyone done this before? Is there a good guide or tutorial you could point me to?

    Any help would be greatly appreciated!
  • Jay Campbell

    1 year ago

    To use the toast from Spark Core, you must subscribe to the "sc-toast-provider" context and the showToast workflow it exposes. Then after your API call you can then trigger this showToast with the appropriate message.

    Note that it might not show in the editor, I normally test them in a new tab.
  • Sakamoto

    1 year ago

    Does this mean the whole page needs to be wrapped in a component including the API call?
    Thanks.
  • Jay Campbell

    1 year ago

    Yes, to subscribe to context it has to be a component child of the provider.
    🙏1
  • Tod

    1 year ago

    Great job @Jay Campbell! Your contribution to the Nordcraft Community just made you advance to Community Level 8! 🌲