Skip to content

Instantly share code, notes, and snippets.

@levlaz
Created April 11, 2018 16:43
Show Gist options
  • Save levlaz/f5289801dd206d4820756ee93fc41ae4 to your computer and use it in GitHub Desktop.
Save levlaz/f5289801dd206d4820756ee93fc41ae4 to your computer and use it in GitHub Desktop.
/**
Enable event sampling. When set to the default of zero, sampling is disabled and all events are sent back to LaunchDarkly.
When set to greater than zero, there is a 1 in samplingInterval chance events will be will be sent.
Example: if you want 5% sampling rate, set samplingInterval to 20.
**/
var ldclient = LDClient.initialize('YOUR_CLIENT_SIDE_ID', user, options = {
samplingInterval: 20
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment