Skip to content

v1.2.0

Choose a tag to compare

@ipakhomov ipakhomov released this 01 Dec 12:08
· 55 commits to main since this release

What's Changed

  • chore: update workspace dependencies by @Tomass673 in #39
  • feat: pusher websocket service enhancements by @ipakhomov in #40
  • feat: add pusher websockets RN hook and update readme by @ipakhomov in #41
  • feat: setup CI by @ipakhomov in #42
  • chore: reconfigure package builds by @ipakhomov in #43

Pusher websockets utilities change

  1. WebSocketService now requires calling init() before connect() as per Pusher docs.
    The init() method now can accept:
  • a token getter function for dynamic token retrieval, ensuring the latest authentication token is always used;
  • set of handlers to pass callbacks into pusher client instance

Migration:

// Before
await webSocketService.connect('your-auth-token');

// After
const tokenGetter = () => getAuthToken(); // Function that returns current token
await webSocketService.init(tokenGetter, {
    // Optional handlers
    onConnectionStateChange: (currentState) => {
      // Do something with the connection state
    },
  }
);
webSocketService.connect();
  1. Added new hook usePusherReactNative that automatically manages WebSocket connection lifecycle for React Native apps.

Full Changelog: v1.1.0...v1.2.0