How to use the @iabtcf/core.TCString.encode function in @iabtcf/core

To help you get started, we’ve selected a few @iabtcf/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github InteractiveAdvertisingBureau / iabtcf-es / modules / site / src / components / pages / TCStringEncode.vue View on Github external
private update(): void {

    try {

      this.encodedTCString = TCString.encode(this.tcModel);

    } catch (err) {

      this.encodedTCString = 'ERROR... ' + err;

    }

  }
github InteractiveAdvertisingBureau / iabtcf-es / modules / site / src / components / pages / TCStringEncode.vue View on Github external
for (const id in specialFeatures) {

        if (specialFeatures.hasOwnProperty(id)) {

          const specialFeature: Feature = specialFeatures[id];
          this.specialFeatures_.push({
            text: specialFeature.name,
            value: id,
          });

        }

      }

      this.encodedTCString = TCString.encode(this.tcModel);

    });
github InteractiveAdvertisingBureau / iabtcf-es / modules / cmpapi / src / command / responsebuilders / TCDataBldr.ts View on Github external
public constructor(tcModel: TCModel, eventStatus: EventStatus, _vendorIds?: number[]) {

    super();

    const vendorIds: string[] = this.getVendorIds(tcModel, _vendorIds);
    const purposeIds: string[] = Object.keys(tcModel.gvl.purposes);
    const specialFeatureIds: string[] = Object.keys(tcModel.gvl.specialFeatures);

    this.tcString = TCString.encode(tcModel);
    this.eventStatus = eventStatus;
    this.isServiceSpecific = tcModel.isServiceSpecific;
    this.useNonStandardStacks = tcModel.useNonStandardStacks;
    this.purposeOneTreatment = tcModel.purposeOneTreatment;
    this.publisherCC = tcModel.publisherCountryCode;

    this.outOfBand = {
      allowedVendors: createBooleanVector(tcModel.vendorsAllowed),
      discloseVendors: createBooleanVector(tcModel.vendorsDisclosed),
    };

    this.purpose = {

      consents: this.createVectorField(purposeIds, tcModel.purposeConsents),
      legitimateInterests: this.createVectorField(purposeIds, tcModel.purposeLegitimateInterest),

@iabtcf/core

Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).

Apache-2.0
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis