Client Setup

To use sockethub from within the browser, you'll be establishing a websocket client and sending and receiving simple JSON objects to the client.

First, include the

script, and then the following sequence connects to Sockethub, sets your Twitter credentials, and fetches your tweets:

This example assumes you're running Sockethub on


The 4 values you have to put in for the Twitter credentials can be obtained by registering a Twitter app and then also generating an access token.

Now watch the console. You should see a series of "messages" events after a few "completed" events, logged to the console.

For more examples, you can browse to

and for more documentation see the Sockethub Wiki.

code hosted on github