Skip to content

Commit

Permalink
chore: streaming example
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Dec 5, 2024
1 parent 099093b commit ca6cc15
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/streaming.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { Unleash } = require('../lib');

const client = new Unleash({
appName: 'my-application',
url: 'https://app.unleash-hosted.com/demo/api/',
customHeaders: {
Authorization: '943ca9171e2c884c545c5d82417a655fb77cec970cc3b78a8ff87f4406b495d0',
},
experimentalMode: { type: 'streaming' },
skipInstanceCountWarning: true,
});
client.on('changed', () => {
console.log(client.isEnabled('demo001', { userId: `${Math.random()}` }));
});

0 comments on commit ca6cc15

Please sign in to comment.