Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@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 5,600 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.