@veribenim/react 1.0.0 → 3.0.0

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.
Files changed (2) hide show
  1. package/README.md +85 -0
  2. package/package.json +4 -3
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # @veribenim/react
2
+
3
+ > Veribenim KVKK & GDPR çerez onayı SDK — React
4
+
5
+ [![npm](https://img.shields.io/npm/v/@veribenim/react)](https://www.npmjs.com/package/@veribenim/react)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Kurulum
9
+
10
+ ```bash
11
+ npm install @veribenim/react
12
+ ```
13
+
14
+ ## Kurulum
15
+
16
+ Uygulamanızın kök bileşenine `VeribenimProvider` ekleyin:
17
+
18
+ ```tsx
19
+ import { VeribenimProvider } from '@veribenim/react';
20
+
21
+ export default function App() {
22
+ return (
23
+ <VeribenimProvider config={{ token: 'BURAYA_TOKEN_YAPISTIRIN' }}>
24
+ <YourApp />
25
+ </VeribenimProvider>
26
+ );
27
+ }
28
+ ```
29
+
30
+ ## Hooks
31
+
32
+ ### `useVeribenim()`
33
+
34
+ ```tsx
35
+ import { useVeribenim } from '@veribenim/react';
36
+
37
+ function CookieBanner() {
38
+ const { preferences, accept, decline, savePreferences } = useVeribenim();
39
+
40
+ if (preferences) return null; // Zaten karar verilmiş
41
+
42
+ return (
43
+ <div>
44
+ <button onClick={() => accept()}>Tümünü Kabul Et</button>
45
+ <button onClick={decline}>Reddet</button>
46
+ </div>
47
+ );
48
+ }
49
+ ```
50
+
51
+ ### `useConsentCategory(category)`
52
+
53
+ ```tsx
54
+ import { useConsentCategory } from '@veribenim/react';
55
+
56
+ function Analytics() {
57
+ const analyticsAllowed = useConsentCategory('analytics');
58
+ if (!analyticsAllowed) return null;
59
+ return <GoogleAnalytics />;
60
+ }
61
+ ```
62
+
63
+ ### `useVeribenimClient()`
64
+
65
+ Form rızası ve DSAR işlemleri için doğrudan API client'a erişin:
66
+
67
+ ```tsx
68
+ import { useVeribenimClient } from '@veribenim/react';
69
+
70
+ function ContactForm() {
71
+ const client = useVeribenimClient();
72
+
73
+ const handleSubmit = async (e) => {
74
+ await client.logFormConsent({
75
+ formName: 'contact',
76
+ consented: true,
77
+ consentText: 'KVKK kapsamında verilerimin işlenmesini onaylıyorum.',
78
+ });
79
+ };
80
+ }
81
+ ```
82
+
83
+ ## Lisans
84
+
85
+ MIT © [Pariette](https://veribenim.com)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veribenim/react",
3
- "version": "1.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "Veribenim KVKK/GDPR çerez onayı SDK - React",
5
5
  "keywords": [
6
6
  "kvkk",
@@ -28,10 +28,11 @@
28
28
  }
29
29
  },
30
30
  "files": [
31
- "dist"
31
+ "dist",
32
+ "README.md"
32
33
  ],
33
34
  "dependencies": {
34
- "@veribenim/core": "1.0.0"
35
+ "@veribenim/core": "3.0.0"
35
36
  },
36
37
  "peerDependencies": {
37
38
  "react": ">=17.0.0",