The snippet below connects to channels and subscribes to a channel :-

Console

// For react-native
npm install pusher-js @react-native-community/netinfo

// For react
npm install pusher-js