JSO ships client libraries for nine languages. Every client targets the same HttpApi.ashx endpoint, sends the same JSON shape, parses the same Report back, and exposes the same three named presets. Pick the one that matches the release environment your team already uses; protection behavior stays consistent across clients.
Side-by-side example
The same "protect app.js and print the BuildId" task in each language. The body of the program is structurally identical because the surface is.
Node:
npx jso-protector --config jso.config.json --label "$GIT_COMMIT" --report jso-report.json
Python:
from jso_protector import protect
result = protect(
files={"app.js": open("dist/app.js").read()},
preset="balanced", label=os.environ.get("GIT_COMMIT"))
print("BuildId:", result.build_id)
Go:
res, err := jso.Protect(ctx, jso.Request{
Files: map[string]string{"app.js": string(src)},
Preset: "balanced", Label: os.Getenv("GIT_COMMIT"),
})
log.Println("BuildId:", res.BuildID)
.NET:
var r = await client.ProtectAsync(new ProtectOptions {
Files = new() { ["app.js"] = src },
Preset = "balanced",
Label = Environment.GetEnvironmentVariable("GIT_COMMIT"),
});
Console.WriteLine($"BuildId: {r.BuildId}");
Ruby:
result = JsoProtector.protect(
files: { "app.js" => File.read("dist/app.js") },
preset: "balanced", label: ENV["GIT_COMMIT"])
puts "BuildId: #{result.build_id}"
PHP:
$result = (new \JsoProtector\Client())->protect([
'files' => ['app.js' => file_get_contents('dist/app.js')],
'preset' => 'balanced',
'label' => getenv('GIT_COMMIT') ?: null,
]);
echo "BuildId: {$result->buildId}\n";
Rust:
let result = Client::new().protect(ProtectRequest {
files: HashMap::from([("app.js".into(), src)]),
preset: Some("balanced".into()),
label: env::var("GIT_COMMIT").ok(),
..Default::default()
})?;
println!("BuildId: {:?}", result.build_id);
Java:
var result = client.protect(ProtectOptions.builder()
.files(Map.of("app.js", Files.readString(Path.of("dist/app.js"))))
.preset("balanced")
.label(System.getenv("GIT_COMMIT"))
.build());
System.out.println("BuildId: " + result.buildId());
Kotlin:
val result = client.protect(ProtectRequest(
files = mapOf("app.js" to File("dist/app.js").readText()),
preset = "balanced",
label = System.getenv("GIT_COMMIT")
))
when (result) {
is ProtectResult.Success -> println("BuildId: ${result.buildId}")
is ProtectResult.Failure -> error(result.message)
}