0

I am working on a client and I get the following error 'Missing token, in client side mode please provide a secret error'. Please view the below code:

var stream = require('getstream');
client = stream.connect('q3nwu4pbz222', null, '25553'); 
readonlyToken = client.feed('user', '1').getReadOnlyToken();
user1 = browserClient.feed('user', '1', readonlyToken);
user1.get({limit:1}, callbackWhenFinished);

1 Answers1

2

The problem is with your third line of code:

readonlyToken = client.feed('user', '1').getReadOnlyToken();

This can only be generated by the back-end code, not the JavaScript running in the browser. This is why my previous example for you was using 'client' variables called backendClient and frontendClient to help you differentiate where you needed to execute the different parts of your code.

iandouglas
  • 4,146
  • 2
  • 33
  • 33