Skip to navigation

Read and check features

Features describe what an identity is allowed to use. The app can read every effective feature, request one value, or check whether a named Bool feature is enabled. Plan defaults and identity overrides are resolved by AuthlyX.

For example, a plan might give customers videoQuality = "4K" and enable the Bool feature exportPdf. getFeature reads a value. checkFeature asks whether a Bool feature is enabled. In every example below, the callback or local variable receives the SDK’s reply. Print or inspect that reply before using its data.

SDK version: V3 Beta. These examples use the current downloads. V1 and V2 use different APIs; choose them in the version selector.

Each example assumes app is the AuthlyX client you created in Connect your app. When a method takes a callback, AuthlyX calls it after the reply arrives. A name such as result inside that callback is created there; you do not declare it at the top of your file. For C++ futures, Python or JavaScript await, Java futures, Go errors and Rust ?, read Results.

app.getFeatures(result => Console.WriteLine(result.ok ? result.data.ToString() : result.message));
app.getFeature("videoQuality", result => Console.WriteLine(result.ok ? result.data.ToString() : result.message));
app.checkFeature("exportPdf", result =>
{
if (result.ok)
Console.WriteLine(result.data.ToString());
else
Console.WriteLine(result.code + ": " + result.message);
});

A client-side feature check can control what the interface shows. Your own trusted server must enforce any action that needs protection from a modified client.