stream-chat
Advanced tools
Comparing version 0.1.5 to 0.1.7
@@ -10,4 +10,2 @@ "use strict"; | ||
var _isomorphicWs = _interopRequireDefault(require("isomorphic-ws")); | ||
var _axios = _interopRequireDefault(require("axios")); | ||
@@ -25,4 +23,2 @@ | ||
var _utils = require("./utils"); | ||
var _signing = require("./signing"); | ||
@@ -212,3 +208,3 @@ | ||
} | ||
/* | ||
/** | ||
* disconnect - closes the WS connection | ||
@@ -274,2 +270,3 @@ */ | ||
* @param {string} userID The User ID | ||
* @param {string} exp The expiration time for the token expressed in the number of seconds since the epoch | ||
* | ||
@@ -280,4 +277,10 @@ * @return {string} Returns a token | ||
createToken(userID) { | ||
return (0, _signing.JWTUserToken)(this.secret, userID); | ||
createToken(userID, exp) { | ||
const extra = {}; | ||
if (exp != null) { | ||
extra.exp = exp; | ||
} | ||
return (0, _signing.JWTUserToken)(this.secret, userID, extra, {}); | ||
} | ||
@@ -284,0 +287,0 @@ /** |
{ | ||
"name": "stream-chat", | ||
"version": "0.1.5", | ||
"version": "0.1.7", | ||
"description": "JS SDK for the Stream Chat API", | ||
@@ -5,0 +5,0 @@ "author": "GetStream", |
66830
1944