Pubnub for Angularjs bg Pubnub for Angularjs

Use AngularJS to Build a Fast and Secure Chat App

PubNub gets your data where it needs to go, anywhere in less than 0.25 seconds. Realtime data is easy with PubNub’s AngularJS library. Just inject the PubNub AngularJS service in your app, insert your keys, and go test.

Fusing AngularJS and PubNub is easy. Martin, PubNub’s developer evangelist,
will show you how easy it is in his AngularJS chat app tutorial.

Martin Lagrange
PubNub Developer Evangelist
Martin Lagrange Developer
Languages
French, German, English, Javascript, Ruby

Follow the steps below to build your own AngularJS chat app

1

Create Your PubNub Account

To get started, sign up for a free account.
Once in your account, create a new app then get your keys.

"Get Your PubNub Keys"
2

Install the PubNub AngularJS SDK

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
  1. <!– Include the PubNub library from CDN –>
  2. <script src="//cdn.pubnub.com/sdk/pubnub/pubnub–[VERSION].min.js">
  3. </script>
  4. <!– Include the PubNub AngularJS Service –>
  5. <script src="//cdn.pubnub.com/sdk/pubnub-angular/pubnub-angular-[VERSION].min.js"></script>
  6.  
  7. <script>
  8. angular.module('app').run(['Pubnub', function(Pubnub) {
  9.     // Initialize with your API keys
  10. Pubnub.init({

  11. publish_key: your_pub_key',

  12. subscribe_key: 'your_sub_key',

  13. });

  14. }])
  15. </script>

Or you may want to install the SDK locally with a package manager, such as npm or Bower.

Try PubNub Today

Try Our APIs
  • 1M Transactions
  • 1GB Data Persistence
  • All major Features