@mhosaic/feedback 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -209,7 +209,7 @@ function createApiClient(options) {
209
209
  }
210
210
  return response.json();
211
211
  }
212
- async function checkVisibility(externalId) {
212
+ async function checkVisibility(externalId, email) {
213
213
  const response = await fetcher(
214
214
  `${endpoint}/api/feedback/v1/widget/visibility/`,
215
215
  {
@@ -218,7 +218,10 @@ function createApiClient(options) {
218
218
  ...widgetHeaders(externalId),
219
219
  "Content-Type": "application/json"
220
220
  },
221
- body: JSON.stringify({ external_id: externalId })
221
+ body: JSON.stringify({
222
+ external_id: externalId,
223
+ ...email ? { email } : {}
224
+ })
222
225
  }
223
226
  );
224
227
  if (!response.ok) {
@@ -4756,8 +4759,8 @@ function createFeedback(config) {
4756
4759
  capture_method: captureMethod,
4757
4760
  technical_context
4758
4761
  };
4759
- if ("0.18.0") {
4760
- payload.widget_version = "0.18.0";
4762
+ if ("0.18.1") {
4763
+ payload.widget_version = "0.18.1";
4761
4764
  }
4762
4765
  if (manualScreenshot) payload.screenshot = manualScreenshot;
4763
4766
  if (values.synthetic) payload.synthetic = true;
@@ -4798,7 +4801,10 @@ function createFeedback(config) {
4798
4801
  // Phase 4: the manifest tells the loader whether this project gates the
4799
4802
  // widget per end-user; the loader forwards it as `requiresVisibilityCheck`.
4800
4803
  requiresVisibilityCheck: config.requiresVisibilityCheck ?? false,
4801
- checkVisibility: (externalId) => api.checkVisibility(externalId)
4804
+ // Send the identified email alongside the id so an email-based allowlist
4805
+ // can match (the backend matches external_id OR email). Read from `user`
4806
+ // live so identity set after createFeedback() is reflected.
4807
+ checkVisibility: (externalId) => api.checkVisibility(externalId, user?.email)
4802
4808
  });
4803
4809
  const instance = {
4804
4810
  show() {
@@ -4847,4 +4853,4 @@ function createFeedback(config) {
4847
4853
  export {
4848
4854
  createFeedback
4849
4855
  };
4850
- //# sourceMappingURL=chunk-4QQI5ZYD.mjs.map
4856
+ //# sourceMappingURL=chunk-5FVEQYA5.mjs.map