Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@threekit/analytics
Advanced tools
A package for recording analytics from a front-end application.
Install the package via your favorite package manager:
npm install @threekit/analytics
It’s recommended to initialize the Session object as a global singleton in your front-end application:
const orgId = '...'; // the UUID for your org
const publicToken = '...'; // a public token for your org
const host = 'admin-fts.threekit.com'; // the host for your org
export const getCurrentSession = () => {
const session = getSession({
auth: { orgId, publicToken, host }
});
session.log = false;
return session;
};
When presenting a set of options to the user, such as a dropdown or grid, use this event to record the details of those options:
getCurrentSession().optionsShow({
optionsSetId: attributeName,
options: values.map((value) => ({
optionId: value,
optionName: value
})),
optionsType: OptionsType.Value
});
Record the event when the user selects an option that was shown to them:
getCurrentSession().optionInteraction({
optionsSetId: attributeName,
interactionType: OptionInteractionType.Select,
optionId: value
});
In a multi-step configuration, each step is referred to as a stage. Use this event to record the start of each stage:
getCurrentSession().stage({ stageName: 'Confirm Selections' });
For each item a user adds to the cart, record it with this event:
getCurrentSession().addToCart({
assetId: itemId,
configuration: simplifiedConfiguration as Configuration,
itemCustomId: itemConfiguration['SKU'] as string | undefined,
itemName: itemConfiguration['Description'] as string | undefined,
itemPrice: itemConfiguration['Price'] as number | undefined,
itemCount: itemConfiguration['skuQty'] as number | undefined
});
When the user makes an order (or a purchase), record the event as follows:
const orderPrice = orderData.reduce(
(previous, current) => previous + current.unitPrice * current.quantity,
0
);
const cartItems = orderData.map((item) => {
return {
itemName: item.description,
itemCustomId: item.name,
itemPrice: item.unitPrice,
itemCount: item.quantity
};
});
getCurrentSession().quote({
orderPrice,
cart: cartItems
});
When the user generates a URL to share the configuration with another user, record the event using:
getCurrentSession().share({
shareLink: configurationUrl,
shareType: ShareType.Share
});
For events in the user experience that don’t fit any predefined category, use a custom event:
getCurrentSession().custom({ customName: 'View Product List' });
For support and questions, please reach out to support@threekit.com.
FAQs
Unknown package
The npm package @threekit/analytics receives a total of 16 weekly downloads. As such, @threekit/analytics popularity was classified as not popular.
We found that @threekit/analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.