Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@automattic/explat-client
Advanced tools
⚠️ You probably shouldn't be using this package directly.
Search for createExPlatClient
within your codebase to find your platform's implementation.
This is a standalone client for Automattic's ExPlat, allowing use of ExPlat in any Javascript context.
const exPlatClient = createExPlatClient(config)
ExperimentAssignment
ExperimentAssignment
represents an experiment assignment, as an experimenter you just need to look at ExperimentAssignment.variationName
.
variationName === null
: This means you should return the default experience.variationName !== null
: This means you should return the treatment experience. Currently variationName
will always be treatment
, but this may change.This type will likely be extended, it can also be missing in some API functions, particularly in the React side of things. A missing experiment assignment does not mean the default experience, it means we do not have an assignment yet and if we can afford to wait we should, generally displaying a loading experience.
exPlatClient.loadExperimentAssignment
loadExperimentAssignment: (experimentName: string) => Promise<ExperimentAssignment>
const experimentAssignment = await loadExperimentAssignment('experiment_name')
exPlatClient.dangerouslyGetExperimentAssignment
dangerouslyGetExperimentAssignment: ( experimentName: string ) => ExperimentAssignment
// An experiment MUST be loaded beforehand:
loadExperimentAssignment( 'experiment_name' );
// Then, significantly enough in the future for the loading to have occurred:
const experimentAssignment = dangerouslyGetExperimentAssignment( 'experiment_name' );
This is an "asyncronous escape hatch", allowing you to use ExPlat in more synchronous code such as within /lib
.
Checklist for use:
loadExperimentAssignment
get called before dangerouslyGetExperimentAssignment
gets called.loadExperimentAssignment
get called significantly before it (minimum 2 seconds looking at perf data, 5-10 seconds is best).dangerouslyGetExperimentAssignment
wrapped in a try-catch blockconsole.log
errors being emitted?FAQs
Standalone ExPlat Client.
The npm package @automattic/explat-client receives a total of 4,421 weekly downloads. As such, @automattic/explat-client popularity was classified as popular.
We found that @automattic/explat-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 49 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.