mirror of
https://github.com/strapi/strapi.git
synced 2025-08-17 13:16:08 +00:00
Add success event during installation
This commit is contained in:
parent
6fa1786e19
commit
a2d8d622b0
21
packages/strapi/lib/utils/success.js
Normal file
21
packages/strapi/lib/utils/success.js
Normal 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(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -71,6 +71,9 @@
|
|||||||
"strapi-generate-service": "3.0.0-alpha.21",
|
"strapi-generate-service": "3.0.0-alpha.21",
|
||||||
"strapi-utils": "3.0.0-alpha.21"
|
"strapi-utils": "3.0.0-alpha.21"
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "node lib/utils/success.js"
|
||||||
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"email": "hi@strapi.io",
|
"email": "hi@strapi.io",
|
||||||
"name": "Strapi team",
|
"name": "Strapi team",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user