الانتقال إلى المحتوى
DocsSDKGDPR والموافقات

GDPR والموافقات

تم التحديث يوليو 2026·1 min

أدوات GDPR برمجيًا: اطلب تصدير بيانات مساحة العمل واحتفظ بسجل موافقات قابل للتدقيق لكل جهة اتصال.

صفحة إعدادات الحساب في مساحة عمل Medal Social.صفحة إعدادات الحساب في مساحة عمل Medal Social.

مثال سريع

مُدقّق الأنواع مقابل ‎@medalsocial/sdk v1.3.0 (2026-07-20). أي إصدار يغيّر توقيعًا يوقف بناء هذه الصفحة.

ts
import { Medal } from '@medalsocial/sdk';

const medal = new Medal(process.env.MEDAL_API_KEY as string);

// Kick off a workspace data export
const { data: request } = await medal.gdpr.requestExport();
console.log(request.request_id, request.status);

// Record consent for a contact
await medal.gdpr.recordConsent({
  email: 'nora@solsticecoffee.no',
  consent_type: 'marketing_email',
  granted: true,
  source: 'signup-form',
});

// Look up a contact's consent history
const { data: consents } = await medal.gdpr.getConsent('nora@solsticecoffee.no');
console.log(consents.length, 'consent records');

medal.gdpr.requestExport()

Request a workspace data export. Runs asynchronously.

ts
requestExport(): Promise<ApiResponse<{ request_id: string; status: string; }>>
أُضيف في v1.0.0

medal.gdpr.listExports()

List all workspace export requests.

ts
listExports(): Promise<ApiResponse<GdprExport[]>>
أُضيف في v1.0.0

medal.gdpr.getExport()

Get the status of a specific export.

ts
getExport(id: string): Promise<ApiResponse<GdprExport>>
أُضيف في v1.0.0

medal.gdpr.recordConsent()

Record a GDPR consent decision for a contact by email.

ts
recordConsent(input: RecordConsentInput): Promise<ApiResponse<ConsentResult>>
أُضيف في v1.0.0

medal.gdpr.getConsent()

Get all consent records for a contact by email.

ts
getConsent(email: string): Promise<ApiResponse<ConsentRecord[]>>
أُضيف في v1.0.0

medal.gdpr.cookieConsent()

Record cookie consent from an external site (legacy endpoint).

ts
cookieConsent(input: CookieConsentInput): Promise<{ success: boolean; logId?: string; }>
أُضيف في v1.0.0