adaojunior / pusher

The Dart library for interacting with the Pusher HTTP API.
https://pub.dartlang.org/packages/pusher
MIT License
12 stars 13 forks source link

How would you do this implementation? (authorization Bearer) #31

Open arualana opened 3 years ago

arualana commented 3 years ago

This is the javascript example:


const pusher = new Pusher('<pusher api key>', {
      cluster: 'cluster',
      authEndpoint: 'https://test-api.com/test-endpoint',
      auth: {
        headers: {
          'authorization': `Bearer ${token}`
        }
      }
    });

    const channel = pusher.subscribe(`test_channel`);

    channel.bind('news', function(data) {
      console.log(data);
    });

How would I do this auth and binding and subscription with this library in flutter, please?