# 실시간 이벤트, 푸시 알림, 승인을 위한 Dify 플러그인

> 워크플로와 에이전트에서 쓸 수 있는 네 가지 도구를 갖춘 Dify 도구 플러그인입니다. 채널에 이벤트 발행, 푸시 알림 전송, 단계 승인 요청, 그 답변 읽기를 할 수 있습니다.

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

워크플로와 에이전트에서 쓸 수 있는 네 가지 도구를 갖춘 Dify 도구 플러그인입니다. 채널에 이벤트 발행, 푸시 알림 전송, 단계 승인 요청, 그 답변 읽기를 할 수 있습니다.

Package: hibira-io/dify

- Request Approval은 승인하거나 선택지를 고를 수 있는 일회용 링크를 상대에게 보내고, 노드 안에서 최대 9분 동안 답변을 기다릴 수 있습니다. Get Approval로 나중에 답변을 읽을 수도 있습니다.
- 모든 도구는 Dify 에이전트에서도 동작하며, 채널·메시지·질문은 모델이 채웁니다.
- Send Push Notification은 interest 또는 사용자 ID로 iOS, Android, 웹 기기에 알림을 보냅니다.
- 요청은 App secret으로 서명되며 secret 자체는 전송되지 않습니다. 플러그인은 Hibira API와만 통신하고 아무것도 저장하지 않습니다.

## 1. 설치

```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. 설정하기

```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. 승인 요청하기

```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
```

## 시작하기 전에

- 승인은 Hibira 포털에서 만든 앱에서 사용할 수 있습니다. 답변 링크는 한 번만 쓸 수 있고, 설정한 시간이 지나면 만료됩니다.
- Wait for Answer를 0으로 두면 Request Approval이 바로 반환되고 답변 링크가 url에 담깁니다. 링크를 상대에게 보낸 뒤 Get Approval로 기다리세요.
- Send Push Notification에는 App의 Push 탭에 있는 Push Instance ID와 Push Secret Key가 필요합니다.

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