forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.js
More file actions
30 lines (23 loc) · 668 Bytes
/
Copy pathhello.js
File metadata and controls
30 lines (23 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ---------------------------------------------------------------------------
Init PubNub and Get your PubNub API Keys:
http://www.pubnub.com/account#api-keys
--------------------------------------------------------------------------- */
var pubnub = require("../pubnub.js")
var p = pubnub.init({
"subscribe_key" : "new-pam",
"publish_key" : "new-pam",
"secret_key" : "new-pam",
"params" : {},
});
p.publish({
"message" : "foo",
"channel" : "bar",
});
p.publish({
"message" : "foo",
"channel" : "bar",
});
p.grant({
"callback" : function (m) { console.log(m); },
"error" : function (e) { console.error(e); },
});