Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/token.js Secret
Created Nov 8, 2019

Embed
What would you like to do?
// get tokens from stream client
var tokens = {
timeline: {
flat: streamClient.getReadOnlyToken('timeline_flat', userId),
aggregated: streamClient.getReadOnlyToken('timeline_aggregated', userId),
},
notification : streamClient.getReadOnlyToken('notification', userId),
};
// user object.assign to insert tokens from stream and jwt
result = Object.assign({}, result[0], { tokens: tokens }, { jwt: jwtToken });
// send response to client
res.send(200, result);
return next();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.