Introducing Webhooks That Talk Back

Eager is an online store for client-side tools and libraries. We make it as easy to install PhotoSwipe or PACE onto your website as it is to install an app onto your phone. Like many other app stores, Eager faces the challenge of giving app creators the freedom to be creative while maintaining consistency in how apps are installed and used.

Granting app creators freedom, though, is critical to enabling fluid and powerful app installation experiences. Today we are announcing a new tool in our app creator arsenal: bidirectional webhooks. Like webhooks in other services, Eager’s hooks allow you to get notified when interesting events happen inside Eager. For example, you can get a notification when a user previews your app or changes options in their install. Unlike most other webhooks though, with Eager, how you respond to a webhook can change your user’s install experience.

For example, you can change the options form your users see based on options they select earlier in the process. Or you can allow your users to OAuth into your service during the install process.

This is what, in fact, powers our new Disqus install flow. In the Disqus app, you can log into your Disqus account using OAuth, and can then select from a list of your forums. You can even create a new forum right inside Eager. Most importantly, we aren’t special-casing Disqus in any way. You can use these same tools with your own Eager apps.

Building a user interface around external services has some complications:

  • It was important to disable the UI in a graceful way while hooks which might change the UI are executing, to prevent work from being lost when the hook responds. Along with this, we needed a way for app creators can specify which hooks may need to change the UI, to allow us to avoid exposing the hook activity to the user when it’s not necessary.
  • With the services recieving these hooks not under our control, we needed to ensure a slow service wouldn't cause issues in the Eager UI. We ended up adding aggressive timeouts to limit the impact a slow service can have.
  • Finally, we had to create a method for hooks to expose errors to the user. This is great if the service is working, but runs into a problem processing the request. Sometimes services are fully down, not responding to requests at all. To handle this, we allow hooks to specify how widespread failures should be handled, from ignoring the failure all the way to disabling app installation until the issue is resolved.

We also included support for storing private data, only accessable to your hooks, to minimize the need to maintain seperate records in your system. In fact, with Eager handling your billing, embedding and storage, you could build a SaaS business entirely on top of Eager without the need for a database. If you’re interested in experimenting with a new idea, or want to build a quick SaaS tool without having to build an installation/setup UI, give it a shot! We aren’t interested in locking you in, we’ll be happy to provide you with a download of your user’s data if you decide to try other options.

If you have an Eager app take a look at the hooks documentation. If you’ve never built an Eager app, now is the time! Most client-side projects can be added to Eager with just a single configuration file.

Finally, if you have a website, install Eager! We have dozens of free apps you can add to your website today to make it more powerful, more quick and more beautiful.

Like this post? Share it with your followers.

Sign up to get our next post delivered to your inbox.

Follow us to get our latest updates.