Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miguelToscano/w3ns
https://github.com/miguelToscano/w3ns
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/miguelToscano/w3ns
- Owner: miguelToscano
- License: mit
- Created: 2023-06-05T09:59:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-10T00:12:34.000Z (about 1 year ago)
- Last Synced: 2024-08-02T06:17:11.424Z (3 months ago)
- Language: Rust
- Size: 12.6 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-internet-computer - W3NS - An Internet Computer service for notifications. (Messaging / Analytical Methodologies)
README
# W3NS
An Internet Computer service for notifications# Getting an API key
We use Courier notifications API in order to integrate with different providers.- Create an account in https://www.courier.com/
- Sign in
- Go to Settings > API Keys
- Generate New API key# Register your API Key
Now you need to register your API key in order to let W3NS send notifications on your behalf`dfx canister --wallet= call w3ns register_key "(\"\")"`
# Courier Channels setup
W3NS currently supports 3 notifications channels:- `Gmail` for emails
- `Twilio` for SMS
- `Firebase FCM` for pushTo set up a Courier Channel:
- Sign in to https://www.courier.com/
- Go to Channels > Add Channel
- Follow the steps for each of the providers that W3NS supports (Gmail, Twilio, Firebase FCM)# Sending notifications
For the following steps to work you should already have your Courier's API key registered as well as the Courier's providers configured.
Each notification sending method requires a 4000000000 cycles payment in order to cover for cycles consumed.
## Send email
You can send emails via W3NS by running:`dfx canister --wallet= call --with-cycles=4000000000 w3ns send_email "(record { to=\"\"; subject=\"\"; body=\"\" })"`
## Send SMS
You can send SMS via W3NS by running`dfx canister --wallet= call --with-cycles=4000000000 w3ns send_sms "(record { to=\"\"; message=\"\" })"`
## Send Push
You can send Push notifications via W3NS by running`dfx canister --wallet= call --with-cycles=4000000000 w3ns send_push "(record { to=\"\"; title=\"\"; body=\"\" })"`
## Send push to topic
To send a push notifcations to users subscribed to a certain topic first you have to create it and subscribe users to it### Create a topic
`dfx canister --wallet= call w3ns create_topic "(\"\")"`### Subscribe a user to a topic
`dfx canister --wallet= call w3ns subscribe_user_to_topic "(record { topic=\"\"; registration_token=\"\" })"`### Send push notification to users subscribed to a topic
`dfx canister --wallet= call --with-cycles=4000000000 w3ns send_push_to_topic "(record { title=\"\"; body=\"\"; topic=\"\" })"`### Unsubscribe user from a topic
`dfx canister --wallet= call w3ns unsubscribe_user_from_topic "(record { topic=\"\"; registration_token=\"\" })"`