File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ npm i rxjs --save (because this is a peer dependency of the Kentico Kontent Deli
3232 projectId: ' xxxx-xxx-xxxx-xxxx-xxxxx' ,
3333 enableAdvancedLogging: false ,
3434 previewApiKey: ' xxxxxxxxxxxxxxxxxxxxxxxxxxx' ,
35- enablePreviewMode: true ,
35+ globalQueryConfig: {
36+ usePreviewMode: true , // Queries the Delivery Preview API.
37+ },
3638 baseUrl: ' https://custom.uri/api/KenticoKontentProxy' ,
3739 securedApiKey: ' xxx' ,
3840 enableSecuredMode: true
Original file line number Diff line number Diff line change @@ -5,8 +5,20 @@ export default (ctx, inject) => {
55 // Create new delivery client Instance
66 let settings = JSON . parse ( 'KENTICOOPTIONS' )
77
8- // Add tracking header
9- settings = Object . assign ( { } , settings )
8+ // Adds globalQueryConfig if not already set
9+ if ( ! settings . globalQueryConfig )
10+ {
11+ settings . globalQueryConfig = { }
12+ }
13+ // Adds customHeaders if not already set
14+ if ( ! settings . globalQueryConfig . customHeaders )
15+ {
16+ settings . globalQueryConfig . customHeaders = [ ]
17+ }
18+ // Adds X-KC-SOURCE to identify this module is in use
19+ settings . globalQueryConfig . customHeaders . push (
20+ { header : 'X-KC-SOURCE' , value : 'kentico-kontent-nuxt-module' }
21+ ) ;
1022
1123 const deliveryClient = new DeliveryClient ( settings )
1224
You can’t perform that action at this time.
0 commit comments