From 039fc85fff52eeed077f92073e0276917ccd5081 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Thu, 25 Apr 2024 19:23:36 -0500 Subject: [PATCH] widgetId from params --- frontend/src/Widget.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/Widget.jsx b/frontend/src/Widget.jsx index 37417a4..9364cdc 100644 --- a/frontend/src/Widget.jsx +++ b/frontend/src/Widget.jsx @@ -254,8 +254,10 @@ function Widget() { useEffect(() => { console.log('window.location', window.location); + const { searchParams } = new URL(window.location.href); + const widgetId = searchParams.get('widgetId'); - widgetApi.current = widgetApi.current ?? new WidgetApi('50aaf929-a90d-4507-9ecc-cd0620d1c780'); + widgetApi.current = widgetApi.current ?? new WidgetApi(widgetId); console.log('widget api', widgetApi.current);