diff --git a/libs-private/service-logic/services/authkit-demo/logic/link.api.ts b/libs-private/service-logic/services/authkit-demo/logic/link.api.ts index 6068ccf..e762dac 100644 --- a/libs-private/service-logic/services/authkit-demo/logic/link.api.ts +++ b/libs-private/service-logic/services/authkit-demo/logic/link.api.ts @@ -26,12 +26,15 @@ export const createEventLinkTokenApi = async ( const { data } = matchResultAndHandleHttpError(settings, identity); + const isLiveSecret = secret.includes('sk_live'); + const link = await makeHttpNetworkCall({ method: 'POST', url: `${url}/v1/event-links/create`, headers, data: { ...payload, + environment: isLiveSecret ? 'live' : 'test', usageSource: 'demo', }, }); @@ -44,8 +47,6 @@ export const createEventLinkTokenApi = async ( ? 'https://development-api.integrationos.com/v1/public/connection-definitions' : 'https://api.integrationos.com/v1/public/connection-definitions'; - const isLiveSecret = secret.includes('sk_live'); - const connectionDefinitions = await makeHttpNetworkCall({ method: 'GET', @@ -84,7 +85,7 @@ export const createEventLinkTokenApi = async ( }, group: linkData?.group, label: linkData?.label, - environment: 'live', + environment: isLiveSecret ? 'live' : 'test', expiresAt: new Date().getTime() + 5 * 1000 * 60, sessionId: generateId('session_id'), features: data?.features