
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@shopyourway/dynamo
Advanced tools
Generate a js API for analytics based on a json file containing the business actions to track

Dynamo generates an analytics javascript API based on a json file definition.
When you report "simple pixels" to GA / MixPanel / Omniture you must implement in your analytics tracker layer all the dimensions and metrics index. For example:
ga('send', 'event', 'Catalogs', 'Add', {
'dimension1': 'Product',
'metric1': 1});
Working that way is hard to keep your analytics aligned between all platforms and feature in your organization. Currently Dynamo support generation a JS API from an input json file. In the future it will also supports other languges.
Using this json file you will be able to have 1 business language for your business analytics. You can create this json file through your CMS system for example and give the ability for PM / data analyst to define the analytics that your product needs to report. Dynamo uses a middle layer called tagManagerReporter that you can later on map to your dimensions and metrics and report to the analytics vendor / tag manager you work with.
Import dynamo package:
const generate = require('@shopyourway/dynamo');
Use the generator instance to generate the js analytics API
const fs = require('fs');
const metadata = JSON.parse(fs.readFileSync('PATH_TO_JSON_FILE'));
const output = generate(metadata, { footerFile: footerFile, importStatements: importStatements });
fs.writeFile('PATH_TO_JS_OUTPUT_API', output);
Suppose you have the following JSON file:
{
"eventDefinitions": {
"actionsList": [
"Add To Catalog"
]
},
"definitions": {
"addToCatalog": {
"parameters": {
"entityType": "string"
},
"dimensions": {
"eventAction": "Add To Catalog",
"entityType": "{{entityType}}"
},
"metrics": [ "engagementMetric", "addToCatalogMetric" ],
"eventType": "event"
}
}
}
The output will be:
import tagManagerReporter from './tag-manager-reporter';
export var actions = {
"addToCatalog": "Add To Catalog"
};
var actionsValues = {
"Add To Catalog": 1
};
export function addToCatalog(entityType) {
const eventData = {};
eventData.eventAction = `Add To Catalog`;
eventData.entityType = `${entityType}`;
eventData.engagementMetric = `1`;
eventData.addToCatalogMetric = `1`;
tagManagerReporter.link(eventData);
}
With the new file you can
myGeneratedAnalytics.addToCatalog('Product');
We encorage contribution via pull requests on any feature you see fit.
When submitting a pull request make sure to do the following:
To run tests, in command line simply run npm test
FAQs
Generate a js API for analytics based on a json file containing the business actions to track
We found that @shopyourway/dynamo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.