OWL never sleeps!

Tiny flagship real time web push notification / message service based on WebSocket. It works on cross browser, cross platform and cross environment. So, waiting for?

Usages

  • Real-time notification
  • Purchase alert
  • Web alert
  • Send LIVE notice
  • Live CHAT
  • Audio call
  • Video call
  • Screen shares
  • Reverse sharing (Live to Local)

Get Started

ES6

npm i -D owl-client

Play with CDN

<script src="https://owl.appdets.com/owl.js"></script>

JSDeliver

<script src="https://owl.appdets.com/owl.js"></script>

Authentication

ES6

// ES6
import Owl from 'owl-client';

// Non-module / CDN
const Owl = window.Owl;

// authenticate
const publicKey = "YOUR_PUBLIC_KEY;" // just received messages
const privateKey = "YOUR_PRIVATE_KEY"; // also can send messages

const msg = new Owl(publicKey);

Send your first message

msg.send('Hello world');

// or 

msg.send({
    type: "msg",
    text: "This is a JSON message"
})

Receive your first message

msg.message((msg) => {
    console.log(msg)
    // Hello world
});

//or 

msg.on("message", (msg) => {
    console.log(msg)
    // Hello world
});

Other events

msg.ready((data) => {
    // Owl is ready to send or receive data
});

Mainstream socket methods

Owl supports mainstream socket events like

msg.on("connect", () => {
    // Owl connected
});

List of the events

connect

connect_error

disconnect

error

ping

reconnect

reconnection_attempt

reconnect_error

reconnect_failed

Debug

You can turn on debugging mode by using this method

// turn on debugging mode
msg.debug();

// or 

msg.debug(false); // will stop debugging

Send message using REST API

You can also send message using REST API following the method bellow

Using CURL

curl https://owl.appdets.com/api -a 
   -H "Accept: application/json"
   -H "Authorization: Bearer {YOUR_PRIVATE_KEY}"
   -d "{\"message\": \"hello world\"}" 

Using JavaScript

(async function(){
    const privateKey = "YOUR_PRIVATE_KEY"
    const req = await fetch('https://owl.appdets.com/api', {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
            Authorization: "Bearer " + privateKey
        },
        body: JSON.stringify({  message: "Hello world" })
    }) 

    const res = await req.json()
    console.log(res)
    // {
    // 	"success": true,
    // 	"message": "Message sent"
    // }
})()

Using WordPress

$private_key = "YOUR_PRIVATE_KEY";

$response = wp_remote_post('https://owl.appdets.com/api', [
    "headers" => [ 
        "Content-Type" =>
         "application/json",
        "Authorization" => "Bearer " . $private_key
    ],
    "body" => [
        "message" => "hello world"
    ]
]); 

$responseBody = json_decode(wp_remote_retrieve_body( $response )); 
 

Get your Keys!

This is on beta mode, so you have to apply for keys before you start.

Please send a request mail to [email protected] with your proper explanation, like what and why you would like to use Owl for your purpose?

Here is a shortlist of question that we need from you;

  • What is your profession?
  • Why you would like to use Owl?
  • What is the basic cases of your usages?
  • How often you will send/receive data? Like N per day.
  • What is the maximum estimated byte size of your each message?

Contribution?

Ops, currently, contribution on this project is OFF. But you have any suggestion, please send us email at [email protected]

GitHub

View Github