
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Fetches data from Google analytics.
Go to the Credentials page in the Google APIs console.
If you don't have an existing Google Cloud project, click "Create" to create a new project. Otherwise, use the dropdown in the upper left corner to select the existing project that you'd like to use.
Select "Service Account key" from the "Create credentials" dropdown.
Fill out the form for creating a service account key:
This should start a download of the credentials file
The service account that you just created needs to be added as a user to your Google analytics account.
Note: A service account can only be associated with one Google Analytics account at a time. Thus, if you want to use predictive fetching on multiple sites, you'll need to create a separate service account for each.
You can enable this here.
To use the credentials in your project, copy it your project,
and make sure to add it or its folder to gitignore.
You can also opt to take client_email
and private_key
from the credentials file, and add them to env.
To find your view ID, go to Google Analytics. Click the accounts dropdown (it's located in the upper lefthand corner of the screen, right next to the Google Analytics logo). The dialog that opens will have three columns: Analytics Accounts, Properties & Apps, & Views. The far right column ("Views") will contain the View ID for your site.
You can opt to save this in an .env file if you do not want to share this information.
npm i guess-ga
Combined with guess-parser
you can aggregate the route information and map it to your application's parametrized routes:
const { fetch } = require('guess-ga');
const { parseRoutes, ProjectType } = require('guess-parser');
const { JWT } = require('google-auth-library');
const { writeFileSync } = require('fs');
const credentials = require('./secret/credentials.json');
const auth = new JWT(
credentials.client_email,
null,
credentials.private_key,
['https://www.googleapis.com/auth/analytics.readonly']
);
const viewId = '000000000';
const applicationRoutes = parseRoutes('tsconfig.app.json', ProjectType.Angular);
fetch({
auth,
viewId,
period: {
startDate: new Date('2018-1-1'),
endDate: new Date(Date.now())
},
formatter: r => r.replace('/app', ''),
routes: applicationRoutes.map(f => f.path)
}).then(g => {
writeFileSync('data.json', JSON.stringify(g, null, 2));
});
For more details visit https://github.com/guess-js/guess.
MIT
FAQs
Fetch structured data from Google Analytics
The npm package guess-ga receives a total of 258 weekly downloads. As such, guess-ga popularity was classified as not popular.
We found that guess-ga demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.