Giter VIP home page Giter VIP logo

hookly.js's Introduction

hookly.js

####Hookly funnels messages to your front-end application in realtime.

Receive realtime messages sent from anywhere For example, after successful update to data, show changes to the other collaborators. Upon completion of background work update the UI with the result. Deliver webhooks to your client-side javascript application.

Build Status
Circle CI
Code Climate

##Installation

via npm

npm install hookly.js

via bower

bower install hookly.js

#Getting Started

####Start with an working example and build from there

  1. Connect with your Project token - (called token).
hookly.start('{{token}}');
  1. Publish a new message to a channel - realtime updates when the name changes
hookly.notify('#updates', { id: 1538, name: 'New name' })
  1. Listen for messages published to a specific channel - show changes live
hookly.on('#updates', function(data) {
  // data is { id: 1538, name: 'New name' }
});

Advanced Setup

Send updates to specific user

  1. When your user is logged in, add their user identifier (called uid).
hookly.start('{{token}}', '{{uid}}');
  1. Send a message from the current user to another (who is identified by 5a4f67)
hookly.notify('#updates', '5a4f67', { id: 1538, name: 'New name' }

Testing

Send and receive messages without making external connections

  1. Start hookly with an explicit URL (that points to nothing)
hookly.start('{{token}}', null, 'http://localhost:3000')
  1. Leave all of your other channel listening code alone

  2. Send a message to your channel listeners explicitly call the hookly adapter with a payload

  • Send a slug as the channel
  • Send a body as the object to pass to the channel listener
  • Send a kind of 'local'
hookly.adapter.call(JSON.stringify({slug: '#updates', body: {id: 5}, kind: 'local'}))

hookly.js's People

Contributors

bnorton avatar

Stargazers

Shannon Norton avatar ash bhoopathy avatar Pulkit Agrawal avatar  avatar  avatar

Watchers

 avatar  avatar Pulkit Agrawal avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.