Trying to get realtime feed from getstream.io, but getting error saying "CORS request rejected: https://api.stream-io-api.com/api/v1.0/feed/user/..."
Following is my javascript code and Key,APP_ID and ReadOnlyToken is provided correctly.
var stream = require('getstream');
var client = stream.connect({{Key}}, null, {{APP_ID}});
var user = client.feed('user', 511,{{ReadOnlyToken}});
user.get({ limit:20, offset:0 })
.then(function(response){
console.log(response);
})
.catch(function(error){
console.log(error);
});
What do I need to do to make it work. I want to show users post in realtime at newsfeed. I'm using laravel as backened, and that was working fine and I'm able to get feeds from Feed Manager.
FeedManager::getUserFeed($user_id)->getActivities(0,25)['results'];
This is providing the user's feed but I need to implement realtime via javascript in VueJS.

Problem was I was using older browser working good with new browsers. Also if you used wrong read only token then also CORS error will appear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With