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.