Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(debug: DebugOptions) {
// @ts-ignore
this.client = new Pusher('18c26c0d1c7fafb78ba2', {
cluster: 'us2',
encrypted: true
});
this.channelID = '';
this.debug = debug;
}
created () {
this.pusher = new Pusher('49f09fe21ef2b756c13f', {
encrypted: true,
cluster: 'mt1'
})
let that = this
this.channel = this.pusher.subscribe('chat_channel')
this.channel.bind('chat_saved', function (data) {
that.$emit('incoming_chat', data)
})
this.$on('incoming_chat', function (chatMessage) {
this.incomingChat(chatMessage)
})
},
computed: {
connectToHost() {
this.setState({ connecting: true });
let pusher = new Pusher('b5ee32e8c6b0d68d380b', {
authTransport: 'ajax',
authEndpoint: '/pusher/auth?id=2'
});
let channel;
try {
channel = pusher.subscribe('presence-chat-'+ this.state.clientID);
}
catch(err) {
console.log(err);
this.setState({ connecting: false });
return;
}
let peer;
init(user, lastMessageId) {
if (user) this.user = user
if (lastMessageId) this.lastMessageId = lastMessageId
if (this.pusher || !this.user.id || !this.appId) return
this.pusher = new Pusher(PUSHER_KEY, {
cluster: 'eu',
authEndpoint: `${HUBTYPE_API_URL}/v1/provider_accounts/webhooks/webchat/${this.appId}/auth/`,
forceTLS: true,
auth: {
headers: {
'X-BOTONIC-USER-ID': this.user.id,
'X-BOTONIC-LAST-MESSAGE-ID': this.lastMessageId,
},
},
})
this.channel = this.pusher.subscribe(this.pusherChannel)
let connectionPromise = new Promise((resolve, reject) => {
let cleanAndReject = msg => {
clearTimeout(connectTimeout)
this.pusher.connection.unbind()
this.channel.unbind()
const getPusher = (url) => {
Pusher.logToConsole = true;
Pusher.Runtime.createXHR = () => {
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
return xhr;
};
const pusher = new Pusher(params.PUSHER_KEY, {
cluster: params.PUSHER_CLUSTER,
authEndpoint: url,
auth: {
headers: {
'Content-Type': 'application/json',
'X-XSRF-TOKEN': Cookies.get('XSRF-TOKEN'),
},
},
});
return pusher;
};
constructor(props) {
super(props)
this.pusher = new Pusher('da85029877df0c827e44')
this.appId = this.props.botonicApp.appId
this.userId = this.getUserUUID()
this.subscribePusher(this.pusher)
}
created() {
this.pusher = new Pusher('9fd1b33fcb36d968145f');
},
methods: {
import Pusher from 'pusher-js';
const pusher = new Pusher(dashboard.pusherKey, {
authEndpoint: '/pusher/authenticate',
});
const pusherChannel = pusher.subscribe('private-dashboard');
export default pusherChannel;
constructor() {
this.pusher = new Pusher("5084eb82130619c14d4e", {
cluster: 'eu',
forceTLS: true
});
this.channel = this.pusher.subscribe("my-channel");
this.channel.bind('itemAdded', this.basketChanged);
this.channel.bind('itemUpdated', this.basketChanged);
this.channel.bind('itemRemoved', this.basketChanged);
this.channel.bind('cartEmptied', this.basketChanged);
}