Wired up link-tracking to Ghost services

refs https://github.com/TryGhost/Team/issues/1888
This commit is contained in:
Fabien "egg" O'Carroll 2022-09-13 18:27:27 -04:00 committed by Fabien 'egg' O'Carroll
parent ae281eb226
commit b564e2bd66
3 changed files with 21 additions and 0 deletions

View File

@ -288,6 +288,7 @@ async function initServices({config}) {
const memberAttribution = require('./server/services/member-attribution');
const membersEvents = require('./server/services/members-events');
const linkReplacement = require('./server/services/link-replacement');
const linkTracking = require('./server/services/link-click-tracking');
const urlUtils = require('./shared/url-utils');
@ -315,6 +316,7 @@ async function initServices({config}) {
apiUrl: urlUtils.urlFor('api', {type: 'admin'}, true)
}),
comments.init(),
linkTracking.init(),
linkReplacement.init()
]);
debug('End: Services');

View File

@ -0,0 +1,18 @@
class LinkTrackingServiceWrapper {
init() {
if (this.service) {
// Already done
return;
}
// Wire up all the dependencies
const LinkTrackingService = require('@tryghost/link-tracking');
// Expose the service
this.service = new LinkTrackingService();
return this.service.init();
}
}
module.exports = new LinkTrackingServiceWrapper();

View File

@ -82,6 +82,7 @@
"@tryghost/kg-mobiledoc-html-renderer": "5.3.7",
"@tryghost/limit-service": "1.2.3",
"@tryghost/link-redirects": "0.0.0",
"@tryghost/link-tracking": "0.0.0",
"@tryghost/logging": "2.3.0",
"@tryghost/magic-link": "0.0.0",
"@tryghost/mailgun-client": "0.0.0",