@amplifyup/sdk 0.3.0 → 0.3.1-uat.104.gfd92fe0

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.
package/README.md CHANGED
@@ -668,6 +668,22 @@ track('Product Viewed', { productId: '123' });
668
668
  identify('user-123', { email: 'user@example.com' });
669
669
  ```
670
670
 
671
+ ## Visitor consent
672
+
673
+ Tell Amplify UP what your consent banner learned, so form answers are only kept for visitors who agreed:
674
+
675
+ ```typescript
676
+ import { setConsent } from '@amplifyup/sdk';
677
+
678
+ // When the visitor accepts or rejects in your banner:
679
+ setConsent('granted'); // or 'denied'
680
+
681
+ // To forget the choice:
682
+ setConsent(null);
683
+ ```
684
+
685
+ The choice is remembered in the browser and sent with every form submission. Then turn on **My consent banner tells Amplify UP** under Forms › Visitor consent. Until you do, Amplify UP treats a visitor who agreed the same as one who didn't, and keeps no answers for either.
686
+
671
687
  ## Debugging
672
688
 
673
689
  ```js