@veribenim/core 1.0.0 → 2.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.
- package/README.md +96 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @veribenim/core
|
|
2
|
+
|
|
3
|
+
> Veribenim KVKK & GDPR çerez onayı SDK — Framework-agnostic çekirdek
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@veribenim/core)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Kurulum
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @veribenim/core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## İki Kullanım Yolu
|
|
15
|
+
|
|
16
|
+
**Sadece banner göstermek istiyorsanız** — SDK'ya gerek yok. Panelden bundle URL'nizi kopyalayın ve HTML'e ekleyin:
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<script src="https://bundles.veribenim.com/siteadiniz.js" async></script>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Form rızası, DSAR veya diğer API işlemleri için** SDK'yı kullanın. Token'ı [Veribenim Paneli](https://app.veribenim.com)'nden alın.
|
|
23
|
+
|
|
24
|
+
## Kullanım
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { init } from '@veribenim/core';
|
|
28
|
+
|
|
29
|
+
const veribenim = init({
|
|
30
|
+
token: 'BURAYA_TOKEN_YAPISTIRIN',
|
|
31
|
+
lang: 'tr', // 'tr' | 'en' — varsayılan: 'tr'
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Onay kararlarını dinle
|
|
35
|
+
veribenim
|
|
36
|
+
.onAccept((prefs) => {
|
|
37
|
+
if (prefs.analytics) initGoogleAnalytics();
|
|
38
|
+
if (prefs.marketing) initFBPixel();
|
|
39
|
+
})
|
|
40
|
+
.onDecline(() => {
|
|
41
|
+
// Yalnızca zorunlu çerezler aktif
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Form Rızası Takibi
|
|
46
|
+
|
|
47
|
+
İletişim formu, üyelik, bülten gibi formlardaki KVKK onayını kaydedin:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
await veribenim.logFormConsent({
|
|
51
|
+
formName: 'contact',
|
|
52
|
+
consented: true,
|
|
53
|
+
consentText: 'KVKK kapsamında verilerimin işlenmesini onaylıyorum.',
|
|
54
|
+
metadata: { email: 'kullanici@example.com' },
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## DSAR (Veri Sahibi Başvurusu)
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
await veribenim.submitDsar({
|
|
62
|
+
requestType: 'erasure', // access | rectification | erasure | restriction | portability | objection | automated
|
|
63
|
+
fullName: 'Ad Soyad',
|
|
64
|
+
email: 'kullanici@example.com',
|
|
65
|
+
description: 'Tüm verilerimin silinmesini talep ediyorum.',
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Tercih Yönetimi
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
// Mevcut tercihleri oku
|
|
73
|
+
const result = await veribenim.getPreferences();
|
|
74
|
+
console.log(result?.preferences); // { necessary, analytics, marketing, preferences }
|
|
75
|
+
|
|
76
|
+
// Tercihleri kaydet
|
|
77
|
+
await veribenim.savePreferences({
|
|
78
|
+
necessary: true,
|
|
79
|
+
analytics: true,
|
|
80
|
+
marketing: false,
|
|
81
|
+
preferences: true,
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Framework Paketleri
|
|
86
|
+
|
|
87
|
+
| Paket | Açıklama |
|
|
88
|
+
|---|---|
|
|
89
|
+
| [`@veribenim/react`](https://www.npmjs.com/package/@veribenim/react) | React için Provider ve hook'lar |
|
|
90
|
+
| [`@veribenim/nextjs`](https://www.npmjs.com/package/@veribenim/nextjs) | Next.js App Router + Pages Router |
|
|
91
|
+
| [`@veribenim/vue`](https://www.npmjs.com/package/@veribenim/vue) | Vue 3 plugin ve composable |
|
|
92
|
+
| [`@veribenim/nuxt`](https://www.npmjs.com/package/@veribenim/nuxt) | Nuxt 3 modülü |
|
|
93
|
+
|
|
94
|
+
## Lisans
|
|
95
|
+
|
|
96
|
+
MIT © [Pariette](https://veribenim.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veribenim/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Veribenim KVKK/GDPR çerez onayı SDK - Core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kvkk",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"dist"
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md"
|
|
31
32
|
],
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@types/jest": "^29.5.0",
|