@unisyn/notify-client
v1.0.3
Published
PubSub client for Notification Broker System
Downloads
7
Readme
Notification Service Client
Usage
# build
npm run build
# run
npm run dev
| Queue Type | Channel/Topic Name | Pub/Sub | Pinpoint | Destination | Notify Type Index | Status | |:----------:|:-------------------|:-------:|:--------:|:-----------:|:-----------------:|:------:| | standard | sms | x | x | SMS | 3 | Done | | standard | sms_template | x | x | SMS | 3 | Done | | | | | | | | | | standard | push_data | x | x | PUSH | 1 | Done | | standard | push_data_template | x | x | PUSH | 1 | To Do | | standard | push | x | x | PUSH | 1 | Done | | standard | push_template | x | x | PUSH | 1 | To Do | | | | | | | | | | standard | mail | x | x | MAIL | 2 | Done | | standard | mail_template | x | x | MAIL | 2 | Done | | | | | | | | | | standard | in_app | x | x | INAPP | 4 | To Do | | | | | | | | |
| Category id | Category Name | Status | |:-----------:|:----------------|:------:| | 1 | Announcement | active | | 2 | Reminders | active | | 3 | System Messages | active | | 4 | Campaigns | active |
Queue Data Models
PUSH
| Field | Data Type | Default Value | Default In | Relation | Is Required | Details | |:---------------|:------------------|:-------------:|:----------:|:-------------:|:-----------------------------:|:--------------------------------------------------| | application_id | string | | ENV | | Optional | Application ID of Pinpoint | | action | string | | ENV | | Optional | Extra Params [URL, OPEN_APP, DEEP_LINK] | | image | string | | ENV | | Optional | Header image for push notification | | icon | string | | ENV | | Optional | Logo/Icon image for push notification | | data | map[string]string | | | | Optional | Ex. Data : {"type_of": "alarm","page": "booster"} | | priority | string | high | ENV | | Optional | [normal, high] | | destination | string | | | | Required | Notification Token | | title | string | | | | Required | Title of Push Notification | | message | string | | | | Required | Message Body Push Notification | | url | string | | ENV | On Action:URL | Optional | onClick URL |
# Pub/Sub Payload
{
"application_id": "PINPOINT_APP_ID",
"action": "URL",
"image": "HEADER_IMAGE_URL",
"icon": "ICON_URL",
"data": {
"type_of": "alarm",
"page": "booster"
},
"priority": "high",
"destination": "NOTIFICATION_TOKEN",
"title": "Message Title",
"message": "Message Content ",
"url": "http://webpage.net"
}
# About Priority
# normal - The notification might be delayed. Delivery is optimized for battery usage on the recipient's device. Use this value unless immediate delivery is required.
# high - The notification is sent immediately and might wake a sleeping device.
# Amazon Pinpoint specifies this value in the FCM priority parameter when it sends the notification message to FCM.
# The equivalent values for Apple Push Notification service (APNs) are 5, for normal, and 10, for high. If you specify an APNs value for this property,
# Amazon Pinpoint accepts and converts the value to the corresponding FCM value
PUSH With Template
# In Progress
E-MAIL custom
| Field | Data Type | Default Value | Default In | Is Required | Details | |:---------------|:----------|:-------------:|:----------:|:-----------------------------:|:------------------------------------------| | application_id | string | In Env | ENV | Optional | Application ID of Pinpoint | | sender_id | string | In Env | ENV | Optional | E-mail Sender ID | | message_type | string | TRANSACTIONAL | ENV | Optional | Extra Params [TRANSACTIONAL, PROMOTIONAL] | | destination | string | | | Required | Receiver e-mail address | | subject | string | | | Required | MAIL content | | message | string | | | Required | MAIL content |
# Pub/Sub Payload
{
"application_id": "PINPOINT_APP_ID",
"sender_id": "[email protected]",
"message_type": "TRANSACTIONAL",
"destination": "[email protected]",
"subject": "MAIL_SUBJECT",
"message": "MAIL_CONTENT"
}
E-MAIL with template
| Field | Data Type | Default Value | Default In | Is Required | Details | |:---------------|:----------|:-------------:|:----------:|:-----------------------------:|:--------------------------------------------| | application_id | string | In Env | ENV | Optional | Application ID of Pinpoint | | sender_id | string | In Env | ENV | Optional | SMS Sender ID or Header | | message_type | string | TRANSACTIONAL | ENV | Optional | Extra Params [TRANSACTIONAL, PROMOTIONAL] | | destination | string | | | Required | Phone number | | template_name | string | | | Required | Template Name [welcome, pass reset, etc...] | | placeholders | string | | | Required | Placeholders for template |
# Pub/Sub Payload
{
"application_id": "PINPOINT_APP_ID",
"sender_id": "[email protected]",
"message_type": "TRANSACTIONAL",
"destination": "[email protected]",
"template_name": "mail_welcome",
"placeholders": {
"Name": "Sercan",
"Surname": "REYHANLI"
}
}
SMS Normal
| Field | Data Type | Default Value | Default In | Is Required | Details | |:---------------|:----------|:-------------:|:----------:|:-----------------------------:|:------------------------------------------| | application_id | string | In Env | ENV | Optional | Application ID of Pinpoint | | sender_id | string | In Env | ENV | Optional | SMS Sender ID or Header | | destination | string | | | Required | Phone number | | message_type | string | TRANSACTIONAL | ENV | Required | Extra Params [TRANSACTIONAL, PROMOTIONAL] | | message | string | | | Required | SMS content |
# Pub/Sub Payload
{
"application_id": "PINPOINT_APP_ID",
"sender_id": "+90532165xxXX",
"message_type": "TRANSACTIONAL",
"destination": "+90532165xxXX",
"message": "Message Content"
}
SMS With Template
| Field | Data Type | Default Value | Default In | Is Required | Details | |:---------------|:----------|:-------------:|:----------:|:-----------------------------:|:--------------------------------------------| | application_id | string | In Env | ENV | Optional | Application ID of Pinpoint | | sender_id | string | In Env | ENV | Optional | SMS Sender ID or Header | | destination | string | | | Required | Phone number | | message_type | string | TRANSACTIONAL | ENV | Required | Extra Params [TRANSACTIONAL, PROMOTIONAL] | | template_name | string | | | Required | Template Name [welcome, pass reset, etc...] | | placeholders | string | | | Required | Placeholders for template |
# Pub/Sub Payload
{
"application_id": "PINPOINT_APP_ID",
"sender_id": "+90532165xxXX",
"message_type": "TRANSACTIONAL",
"destination": "+90532165xxXX",
"template_name": "welcome_message",
"placeholders": {
"FirstName": [
"Sercan !"
],
"LastName": [
"REYHANLI"
]
}
}
ENV KEYS
# Used Keys
## PUSH
PUSH_QUEUE_DATA: "push_data"
PUSH_QUEUE_DATA_TEMPLATE: "push_data_template"
PUSH_QUEUE_NOTIFY: "push"
PUSH_QUEUE_NOTIFY_TEMPLATE: "push_template"
## SMS
SMS_QUEUE_NORMAL: "sms"
SMS_QUEUE_NORMAL_TEMPLATE: "sms_template"
SMS_QUEUE_OTP: "otp_sms"
SMS_QUEUE_OTP_TEMPLATE: "otp_sms_template"
## MAIL
MAIL_QUEUE_NORMAL: "mail"
MAIL_QUEUE_NORMAL_TEMPLATE: "mail_template"
MAIL_QUEUE_OTP: "otp_mail"
MAIL_QUEUE_OTP_TEMPLATE: "otp_mail_template"