UNPKG

infobip-rtc

Version:

Infobip RTC JavaScript SDK - Infobip WebRTC API Implementation

27 lines 692 B
import jwtDecode from "jwt-decode"; export class AccessToken { constructor(token) { this.jwt = token; this.decodedToken = jwtDecode(token); } get identity() { return this.decodedToken.identity; } get displayName() { return this.decodedToken.name; } get expiration() { return this.decodedToken.exp; } get location() { return this.decodedToken.location; } get altLocation() { return this.decodedToken.altLocation; } get locations() { const locs = this.decodedToken.locations; return Array.isArray(locs) ? locs : undefined; } } //# sourceMappingURL=AccessToken.js.map