diff --git a/ts-binary-wrapper/src/common.ts b/ts-binary-wrapper/src/common.ts index ee4e4eb207..d223fb3bd6 100644 --- a/ts-binary-wrapper/src/common.ts +++ b/ts-binary-wrapper/src/common.ts @@ -21,6 +21,7 @@ const binaryDeploymentsFilePath = path.join( 'generated', 'binary-deployments.json', ); +export const integrationName = 'TS_BINARY_WRAPPER'; export class WrapperConfiguration { private version: string; @@ -191,6 +192,11 @@ export function runWrapper(executable: string, cliArguments: string[]): number { const res = spawnSync(executable, cliArguments, { shell: false, stdio: 'inherit', + env: { + ...process.env, + SNYK_INTEGRATION_NAME: integrationName, + SNYK_INTEGRATION_VERSION: getCurrentVersion(versionFile), + }, }); if (res.status !== null) { @@ -253,7 +259,7 @@ export function downloadExecutable( filenameShasum: string, ): Promise { return new Promise(function(resolve) { - const options = new URL(downloadUrl + '?utm_source=npm'); + const options = new URL(`${downloadUrl}?utm_source=${integrationName}`); const temp = path.join(__dirname, Date.now().toString()); const fileStream = fs.createWriteStream(temp); const shasum = createHash('sha256').setEncoding('hex');