Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python 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,067 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.