1.6.6 • Published 3 months ago

@ketch-sdk/ketch-web-api v1.6.6

Weekly downloads
133
License
MIT
Repository
github
Last release
3 months ago

ketch-web-api

Ketch Web API interface.

Constructor

import {KetchWebAPI} from '@ketch-sdk/ketch-web-api'

const baseUrl: string = 'https://global.ketchcdn.com/web/v2'

const s = new KetchWebAPI(baseUrl)

Create a new KetchWebAPI with the given base url

Get the bootstrap configuration

const request: GetBootstrapConfigurationRequest = {
  organizationCode: 'axonic',
  propertyCode: 'axonic',
}
const config: Configuration = await s.getBootstrapConfiguration(request)

Gets the bootstrap configuration for the specified parameters.

Get the full configuration

const request: GetFullConfigurationRequest = {
  organizationCode: 'axonic',
  propertyCode: 'axonic',
  environmentCode: 'production',
  jurisdictionCode: 'caccpa',
  languageCode: 'es',
}
const config: Configuration = await s.getFullConfiguration(request)

Gets the full configuration for the specified parameters.

Get consent

const request: GetConsentRequest = {
  organizationCode: 'axonic',
  // controllerCode: '', - optional controller
  propertyCode: 'axonic',
  environmentCode: 'production',
  jurisdictionCode: 'caccpa',
  identities: {
    'id1': 'val1',
  },
  purposes: {
    'analytics': {
       // allowed: 'true', - optional, pass in locally stored consent if available
       legalBasisCode: 'disclosure',
    },
  },
  // vendors: string[], - optional, list of TCF vendor ID opted out
  // collectedAt: number, - optional, UNIX timestamp in seconds when the given "allowed" consent was collected
}
const consent: GetConsentResponse = await s.getConsent(request)

Gets the current state of the user's consent flags.

Set consent

const request: SetConsentRequest = {
  organizationCode: 'axonic',
  // controllerCode: '', - optional controller
  propertyCode: 'axonic',
  environmentCode: 'production',
  jurisdictionCode: 'caccpa',
  identities: {
    'id1': 'val1',
  },
  purposes: {
    'analytics': {
      allowed: 'false',
      legalBasisCode: 'consent_optin',
    },
  },
  // vendors: string[], - optional, list of TCF vendor ID opted out
  collectedAt: 2141412414,
}
await s.setConsent(request)

Sets the user's consent flags.

Invoke right

const request: InvokeRightRequest = {
  organizationCode: 'axonic',
  // controllerCode: '',
  propertyCode: 'axonic',
  environmentCode: 'production',
  identities: {
    'id1': 'val1',
  },
  invokedAt: 387642873,
  jurisdictionCode: 'caccpa',
  rightCode: 'erasure',
  user: {
    email: '',
    firstName: '',
    lastName: '',
    // country: '', - optional, ISO-3166 country code
    // stateRegion: '', - optional, region code
    // description: '', - optional, description entered by the data subject
    // phone: '', - optional, ITU formatted telephone number
    // postalCode: '', - optional, postal code
    // addressLine1: '', - optional, address line 1
    // addressLine2: '', - optional, address line 2
    // typeCode: '', - optional, identifier representing the data subject type specified by the user
    // typeRelationshipDetails: '', - optional, additional information provided by the user describing their relation to the business
  },
  // recaptchaToken: string - optional recaptcha token
}
await invokeRight(request)

Invokes the specified rights.

Get preferences QR image

const request: GetPreferenceQRRequest = {
  organizationCode: 'axonic',
  propertyCode: 'axonic',
  environmentCode: 'production',
  // imageSize?: number - image size in pixels such as 256
  // path?: string - path on the property's specified domain
  // backgroundColor?: string - RGB hex of the background color such as ffffff
  // foregroundColor?: string - RGB hex of the foreground color such as 990000
  // parameters: {
  //   'key': 'value',
  // } - additional querystring parameters to pass to the destination page
}
const url: string = await preferenceQR(request)

Get the preferences QR code image URL

1.6.6

3 months ago

1.6.5

3 months ago

1.6.4

4 months ago

1.6.3

4 months ago

1.6.2

4 months ago

1.6.1

4 months ago

1.6.0

4 months ago

1.5.2

5 months ago

1.5.1

5 months ago

1.5.0

5 months ago

1.4.1

6 months ago

1.4.0

7 months ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.0

1 year ago

1.0.9

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.0

1 year ago

1.0.10

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.3

2 years ago

0.1.41

2 years ago

0.1.40

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.38

3 years ago

0.1.39

3 years ago

0.1.36

3 years ago

0.1.37

3 years ago

0.1.35

3 years ago

0.1.34

3 years ago

0.1.33

3 years ago

0.1.32

3 years ago

0.1.31

3 years ago

0.1.30

3 years ago

0.1.29

3 years ago

0.1.28

3 years ago

0.1.27

3 years ago

0.1.26

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.19

3 years ago

0.1.18

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago