Add success event during installation

This commit is contained in:
Aurélien Georget 2019-01-30 10:40:51 +01:00
parent 6fa1786e19
commit a2d8d622b0
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/usr/bin/env node
'use strict';
/**
* Module dependencies
*/
// Node.js core.
const fetch = require('node-fetch');
if (process.env.npm_config_global === 'true') {
fetch('https://analytics.strapi.io/track', {
method: 'POST',
body: JSON.stringify({ event: 'didInstallStrapi' }),
headers: { 'Content-Type': 'application/json' }
})
.catch(() => {});
}

View File

@ -71,6 +71,9 @@
"strapi-generate-service": "3.0.0-alpha.21",
"strapi-utils": "3.0.0-alpha.21"
},
"scripts": {
"postinstall": "node lib/utils/success.js"
},
"author": {
"email": "hi@strapi.io",
"name": "Strapi team",