Skip to main content
Version: 57.2.0

syncConsents

syncConsents(definitions, options?): Promise<SyncConsentsResult>

Sync consent form definitions to the database.

Parameters

definitions

Record<string, ConsentFormDefinition>

Map of slug to consent form definition

options?

SyncConsentsOptions = {}

Sync options

Returns

Promise<SyncConsentsResult>

Summary of what was created, updated, deactivated, or unchanged

Example

import {syncConsents} from "@terreno/api";

await syncConsents({
"terms-of-service": {
title: "Terms of Service",
type: "terms",
content: {"en": "# Terms\n...", "es": "# Términos\n..."},
required: true,
order: 1,
},
"privacy-policy": {
title: "Privacy Policy",
type: "privacy",
content: {"en": "# Privacy\n..."},
order: 2,
},
});