Skip to navigation

Read and update metadata

Metadata stores extra values on a plan, user, license or device. Read only metadata marked app-readable. An app can update a field only when the developer enabled remote updates for that field. Private metadata stays in the dashboard.

For example, a developer might store customer_note = "Prefers email" and a Bool field beta_access = true. Read fields with getMetadata; use checkMetadata when you need to test a Bool. setMetadata works only for a field the developer marked remotely writable. The examples print the server reply so you can see whether the operation worked.

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.getAllMetadata(result => Console.WriteLine(result.ok ? result.data.ToString() : result.message));
app.getMetadata("customer_note", result => Console.WriteLine(result.ok ? result.data.ToString() : result.message));
app.checkMetadata("beta_access", result => Console.WriteLine(result.ok ? result.data.ToString() : result.message));
app.setMetadata("display_name", "Alex", result => Console.WriteLine(result.ok ? "Metadata updated" : result.message));

Writable metadata is still customer-controlled input. Validate it before using it for a trusted operation. The SDK cannot read private metadata.