Pusher at BattleHack 2015

battlehack_2015.png

Are you the ultimate hacker for good? We are beyond excited to announce that this year Pusher is a global BattleHack partner along with Twitter, Sendgrid, Twilio and others. If you haven’t yet heard, BattleHack is a series of global hackathons organised by PayPal. From Tokyo to Athens, London to Berlin, the best of the \[…\]

Introduction

Are you the ultimate hacker for good?

We are beyond excited to announce that this year Pusher is a global BattleHack partner along with Twitter, Sendgrid, Twilio and others.

If you haven’t yet heard, BattleHack is a series of global hackathons organised by PayPal. From Tokyo to Athens, London to Berlin, the best of the best will be hacking on beyond-imaginable projects. Amazing talented crowds, awesome venues, love from partners and tons of treats and prizes – no doubts here – this is an opportunity not to be missed.

First place winners in each city will get a pretty epic axe, as well as flights and accommodation to attend the World Finals in Silicon Valley, and a chance to win $100K USD.

We will be there to cheer and support you in the following cities: London, Athens, Tokyo, Berlin, Venice, Toronto, New York, Stockholm and Tel Aviv.

How you can use Pusher at BattleHack

Pusher is an evented Pub/Sub platform that can easily be integrated into any technology stack. You can effortlessly add notifications, activity streams, real-time data visualizations, chat and collaborative experiences using our APIs and libraries.

Not only that, but we’re a perfect partner with many of the other BattleHack partner APIs. Anytime you interact with a partner API or get data back from an API you can instantly push that data to client devices using Pusher. For example, an incoming SMS or a phone call from Twilio, an email via SendGrid, Tweets from Twitter, Push location data from BLEep or BlueCats beacons.

The great thing is that using Pusher is as easy as 6 lines of code.

When an interaction, data change or event occurs within the app you’re building, you trigger an event on a channel using Pusher. Let’s take an incoming email WebHook interaction from SendGrid and using the Inbound Parse WebHook as an example:

1// Create Pusher instance using app credentials
2var pusher = new Pusher(appConfig);
3
4// Handle WebHook from SendGrid
5app.post('/sendgrid', function(req, res) {
6var email = {
7from: req.body.from,
8to: req.body.to,
9subject: req.body.subject,
10text: req.body.text
11};
12
13// Trigger an event sending the email to anybody subscribing to
14// the 'sendgrid-email' channel and bound to the 'got-mail' event
15pusher.trigger('sendgrid-email, 'got-mail', email);
16});

On the client you subscribe to the channel the event will be triggered on and bind to the event to receive the data:

1// Connect
2var pusher = new Pusher(appKey);
3
4// Subscribe
5var channel = pusher.subscribe('sendgrid-email');
6
7// Bind
8channel.bind('got-mail', function(email) {
9// Add to UI
10});

You can see how easy it is to do something similar with a Twilio SMS or incoming phone call WebHook, a Braintree payment WebHook or anywhere else you see events occurring within your apps; from system interactions like WebHooks to user interactions where somebody clicks a button in a UI.

We have libraries for Ruby, PHP, Python, Node.js, Java, .NET, JavaScript (browser), Android and iOS so no matter what your tech stack of choice is, we have an option for you.

Of course, we’ll also be at most of the events to help you out. So please grab us if we can help you with anything. Anything at all!

Register for BattleHack

BattleHack is the hottest hack around, so don’t delay – sign up now! Registration is open 24/7.

Good luck and we’re looking forward to see you soon!