# Dify plugin for realtime events, push notifications and approvals

> A Dify tool plugin with four tools for workflows and agents: publish an event to channels, send a push notification, ask a person to approve a step, and read their answer.

Source: https://hibira.io/guides/dify

A Dify tool plugin with four tools for workflows and agents: publish an event to channels, send a push notification, ask a person to approve a step, and read their answer.

Package: hibira-io/dify

- Request Approval sends a person a single-use link to approve or pick a choice, and can wait inside the node for up to 9 minutes. Get Approval reads the answer later.
- Every tool also works in Dify agents, where the model fills in the channel, message or question.
- Send Push Notification reaches iOS, Android and web devices by interest or user ID.
- Requests are signed with the app secret, which is never sent. The plugin only talks to the Hibira API and stores nothing.

## 1. Install

```text
Plugins → Install plugin → Marketplace → Hibira
  or: Install plugin → Local package file →
      hibira-0.1.0.difypkg from github.com/hibira-io/dify/releases
```

## 2. Set it up

```text
Tools → Hibira → API Key Authorization Configuration
  App ID:            YOUR_APP_ID
  Key:               YOUR_APP_KEY
  Secret:            YOUR_APP_SECRET
  Push Instance ID:  optional, for push notifications
  Push Secret Key:   optional
```

## 3. Ask for approval

```text
Start (order, amount)
→ Hibira → Publish Event
    Channels:  orders      Event:  refund-requested
→ Hibira → Request Approval
    Question:  Refund order {{order}} for {{amount}}?
    Options:   Refund, Decline
    Wait for Answer (Minutes):  5
→ IF text starts with Approved → Hibira → Send Push Notification
```

## Before you start

- Approvals work with apps created in the Hibira portal. The answer link is single-use and expires after the time you set.
- With Wait for Answer set to 0, Request Approval returns at once with the answer link in url. Send it to the person, then wait with Get Approval.
- Send Push Notification needs the Push Instance ID and Push Secret Key from the app’s Push tab.

- [Dify Marketplace](https://marketplace.dify.ai/plugin/hibira/hibira)
- [GitHub](https://github.com/hibira-io/dify)
