Skip to content

Instantly share code, notes, and snippets.

@onedebos
Created March 7, 2021 12:48
Show Gist options
  • Save onedebos/27ae29c7a8eb954992bc2ff34177c1cb to your computer and use it in GitHub Desktop.
Save onedebos/27ae29c7a8eb954992bc2ff34177c1cb to your computer and use it in GitHub Desktop.
/pages/_app.js
import '../styles/globals.css'
import Pusher from 'pusher-js'
function MyApp({ Component, pageProps }) {
const {key, cluster} = process.env
const pusher = new Pusher(key, {
cluster
});
const channel = pusher.subscribe('chat');
channel.bind('chat-event', function(data) {
return data
});
return <Component {...pageProps} />
}
export default MyApp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment