tas-client-umd is a Unified Module Definition (UMD) repackaging of the core `tas-client` module, designed to provide a client for interacting with an experimentation service, typically a Treatment Assignment Service (TAS). Its primary function is to query, refetch, and cache experimentation data, often referred to as "flights" or "treatment variables," from a specified endpoint. This package, currently at version 0.2.0, targets early-stage development with an implied unstable release cadence typical of pre-1.0 software. A key aspect of its design is the requirement for consumers to implement specific interfaces: `IExperimentationFilterProvider` for supplying contextual filters, `IExperimentationTelemetry` for logging events and shared properties, and `IKeyValueStorage` for persistent data storage. This dependency injection approach allows for flexible integration into various environments and telemetry systems. Its UMD format differentiates it by ensuring compatibility across CommonJS, AMD, and browser global environments, making it versatile for diverse JavaScript ecosystems, particularly where `tas-client` is used.
npm install tas-client-umdVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate `TASClient` with mock interface implementations and retrieve a treatment variable after initialization.
Replace calls to `tasClient.isFlightEnabled(flightName)` with `tasClient.getTreatmentVariable(configId, variableName)`.
Ensure all required interfaces are fully implemented with the necessary methods before instantiating `TASClient`. Refer to the interface definitions for details.
Always await `tasClient.initializePromise` before making synchronous calls to `getTreatmentVariable()`. If an asynchronous API is required before full initialization, use the `getTreatmentVariableAsync()` method.
In CommonJS, use `const { TASClient } = require('tas-client-umd');` or access via the default export if bundling: `const TASClient = require('tas-client-umd').TASClient;`Ensure the `tas-client-umd` script is loaded in your HTML before any code attempts to use `TASClient`. Verify the global variable name exposed by the UMD bundle.
Update your code to use `getTreatmentVariable(configId, name)` instead of `isFlightEnabled(flightName)`.
No dependency data recorded yet.