Skip to content

Commit

Permalink
Add provision for user to pass moi api url to init
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil-narayana-klevu committed May 23, 2024
1 parent 67e52d9 commit 5f91305
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/klevu-ui-vue/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const KlevuInit = /*@__PURE__*/ defineContainer<JSX.KlevuInit>('klevu-ini
'eventsV2Url',
'recommendationsApiUrl',
'visitorServiceUrl',
'moiApiUrl',
'settings',
'language',
'translation',
Expand Down
8 changes: 8 additions & 0 deletions packages/klevu-ui/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ export namespace Components {
* Which language to load
*/
"language": Translations;
/**
* Override the default moi API URL
*/
"moiApiUrl"?: string;
/**
* Override the default recommendations API URL
*/
Expand Down Expand Up @@ -3038,6 +3042,10 @@ declare namespace LocalJSX {
* Which language to load
*/
"language"?: Translations;
/**
* Override the default moi API URL
*/
"moiApiUrl"?: string;
"onKlevuInitSettingsUpdated"?: (event: KlevuInitCustomEvent<KlevuUIGlobalSettings>) => void;
/**
* Override the default recommendations API URL
Expand Down
5 changes: 5 additions & 0 deletions packages/klevu-ui/src/components/klevu-init/klevu-init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export class KlevuInit {
* Override the default session API URL
*/
@Prop() visitorServiceUrl?: string
/**
* Override the default moi API URL
*/
@Prop() moiApiUrl?: string
/**
* Global settings
*/
Expand Down Expand Up @@ -134,6 +138,7 @@ export class KlevuInit {
enableKlaviyoConnector: this.enableKlaviyoConnector || false,
useConsent: this.useConsent || false,
consentGiven: this.consentGiven || false,
moiApiUrl: this.moiApiUrl || "",
})

if (this.translation) {
Expand Down

0 comments on commit 5f91305

Please sign in to comment.