From 473803188b2d0d5647e18dce03a15cf5ff4a379b Mon Sep 17 00:00:00 2001 From: ondrejch Date: Mon, 10 Aug 2020 17:09:09 +0200 Subject: [PATCH] add usage tracking --- examples/cms-kontent/lib/api.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/cms-kontent/lib/api.js b/examples/cms-kontent/lib/api.js index e5509c70a2525..de5151087a910 100644 --- a/examples/cms-kontent/lib/api.js +++ b/examples/cms-kontent/lib/api.js @@ -1,8 +1,17 @@ import { DeliveryClient } from '@kentico/kontent-delivery' +import { name, version } from '../package.json' + +const sourceTrackingHeaderName = 'X-KC-SOURCE' const client = new DeliveryClient({ projectId: process.env.KONTENT_PROJECT_ID, previewApiKey: process.env.KONTENT_PREVIEW_API_KEY, + globalHeaders: (_queryConfig) => [ + { + header: sourceTrackingHeaderName, + value: `@vercel/next.js/example/${name};${version}`, + }, + ], }) function parseAuthor(author) {