@amplifyup/sdk 0.3.0 → 0.3.1-uat.105.g9d5f4eb
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 +16 -0
- package/dist/AmplifyRenderer.js.map +1 -1
- package/dist/AmplifyRenderer.mjs.map +1 -1
- package/dist/index.d.mts +55 -5
- package/dist/index.d.ts +55 -5
- package/dist/index.js +49 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -9
- package/dist/index.mjs.map +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs.map +1 -1
- package/package.json +2 -1
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
|