Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SplitClient split = SplitFactoryBuilder.build("YOUR_API_KEY").client();
String treatment = split.getTreatment("USER_ID", "my-feature");
if (treatment.equals("on")) {
// insert on code here
} else if (treatment.equals("off")) {
// insert off code here
} else {
// insert control code here
}
split := client.NewSplitFactory("YOUR_API_KEY").Client()
treatment := client.Treatment("USER_ID", "my-feature")
if treatment == "on" {
// insert on code here
} else if treatment == "off" {
// insert off code here
} else {
// insert control code here
}
let split = SplitFactory(apiKey: YOUR_API_KEY, key: user_id).client()
let treatment = split.getTreatment("my-feature")
if treatment == "on" {
// insert on code here
} else if treatment == "off" {
// insert off code here
} else {
// insert control code here
}
SplitClient split = SplitFactoryBuilder.build("YOUR_API_KEY").client();
String treatment = split.getTreatment("USER_ID", "my-feature");
if (treatment.equals("on")) {
// insert on code here
} else if (treatment.equals("off")) {
// insert off code here
} else {
// insert control code here
}
const clientConfig = {
core: {
authorizationKey: "YOUR_API_KEY",
key: "USER_ID"
}
};
const split = splitio(clientConfig).client();
split.on(split.Event.SDK_READY, () => {
const treatment = split.getTreatment("my-feature");
if (treatment === "on") {
// insert on code here
} else if (treatment === "off") {
// insert off code here
} else {
// insert control code here
}
});
var factory = new SplitFactory("YOUR_API_KEY");
var split = factory.Client();
var treatment = split.GetTreatment("USER_ID", "my-feature");
if (treatment == "on") {
// insert on code here
} else if (treatment == "off") {
// insert off code here
} else {
// insert control code here
}
const clientConfig = {
core: {
authorizationKey: "YOUR_API_KEY",
key: "USER_ID"
}
};
const split = splitio(clientConfig).client();
split.on(split.Event.SDK_READY, () => {
const treatment = split.getTreatment("my-feature");
if (treatment === "on") {
// insert on code here
} else if (treatment === "off") {
// insert off code here
} else {
// insert control code here
}
});
$split = \SplitIO\Sdk::factory('YOUR_API_KEY')->client();
$treatment = $split->getTreatment('USER_ID', 'my-feature');
if (treatment == 'on') {
// insert on code here
} else if (treatment == 'off') {
// insert off code here
} else {
// insert control code here
}
from splitio import get_factory
split = get_factory('YOUR_API_KEY').client()
treatment = split.get_treatment('USER_ID', 'my-feature')
if treatment == "on":
# insert code here to show on treatment
elif treatment == "off":
# insert code here to show off treatment
else:
# insert your control treatment code here
split = SplitIoClient::SplitFactory.new("YOUR_API_KEY").client
treatment = split.get_treatment("USER_ID", "my-feature")
if treatment == "on"
# insert on code here
elsif treatment == "off"
# insert off code here
else treatment
# insert control code here
end
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.