0.213.0 • Published 2 years ago

@signatu/consent v0.213.0

Weekly downloads
1
License
SEE LICENSE IN LI...
Repository
-
Last release
2 years ago

Signatu Consent for Javascript

This is a Javascript client library for Signatu Consent. It depends on the Signatu service, and the library will load data from signatu.com.

Installation

npm

npm install @signatu/consent

Schema

The JSON Schemas for ConsentRequest and ConsentEvent is available in src/schema.

Usage

All cases require a config object that specifies the apiKey and accessToken:

const config = {
    apiKey: 'MY_API_KEY',
    accessToken: 'MY_ACCESS_TOKEN',
    consentAPI: 'http://url-to-consent-api' /** Optional */,
}

Generic consent

    import {ConsentClient} from '@signatu/consent'

    const client = new ConsentClient(config)

    /** Defaults */
    const options = {
        limitToCurrent: true,
        useCache: false
    }

    const consentTarget = {
        subject: "Some subject ID",
        target: "URL of target",
        scope: "optional list of scopes"
    }
    /** Get the last (current) event */
    const currentEvent = client.load(consentTarget, options)
        .then((consent) => console.log('Consent: ', consent)
        .catch((error) => console.error(error));

    // ...
    const consentEvent = {
        subject: "Some Subject ID",
        target: "URL of target",
        action: true
    }
    const newEvent = consent.save(consentEvent)
        .then((consent) => console.log('New consent: ', consent)
        .catch((error) => console.error(error));

Cookie consent

Cookie Consent uses the standard Consent API, but sets most of the parameters by default.

    import {CookieConsent} from '@signatu/consent'

    const cookieConsent = new CookieConsent(config)
    /* Get current status */
    cookieConsent.getCookieConsent()
        .then(consent => console.log(consent))
        .catch(error => console.error(consent)))
    }

    /* Set new status - true for accept, false for deny */
    cookieConsent.setCookieConsent(true)
        .then(consent => console.log(consent))
        .catch(error => console.error(consent)))

Further information

Go to signatu.com or send us an email on support@signatu.com.

License

This library is MIT Licensed.

0.213.0

2 years ago

0.209.0

3 years ago

0.207.0

3 years ago

0.208.0

3 years ago

0.205.0

3 years ago

0.203.1

3 years ago

0.202.5

3 years ago

0.202.4

3 years ago

0.202.0

3 years ago

0.201.0

3 years ago

0.200.0

3 years ago

0.122.0

3 years ago

0.112.0

4 years ago

0.111.0

4 years ago

0.108.4

4 years ago

0.108.1

4 years ago

0.74.4

5 years ago

0.58.0

5 years ago

0.57.6

5 years ago

0.57.1

5 years ago

0.56.0

5 years ago

0.55.3

5 years ago

0.55.1

5 years ago

0.55.0

5 years ago

0.54.1

5 years ago

0.53.0

5 years ago

0.52.0

5 years ago

0.51.3

5 years ago

0.51.0

5 years ago

0.50.17

5 years ago

0.50.16

5 years ago

0.50.7

5 years ago

0.50.5

5 years ago

0.50.4

5 years ago

0.50.1

5 years ago

0.50.0

5 years ago

0.49.10

5 years ago

0.49.9

5 years ago

0.49.7

5 years ago

0.49.5

5 years ago

0.49.3

5 years ago

0.49.0

5 years ago

0.48.0

5 years ago

0.47.0

5 years ago

0.46.0

5 years ago

0.45.0

5 years ago

0.44.0

5 years ago

0.43.0

5 years ago

0.42.0

5 years ago

0.41.0

5 years ago

0.40.0

5 years ago

0.39.0

5 years ago

0.38.0

5 years ago

0.37.0

5 years ago

0.36.0

5 years ago

0.35.1

5 years ago

0.35.0

5 years ago

0.34.4

5 years ago

0.34.1

5 years ago

0.34.0

5 years ago

0.33.0

5 years ago

0.32.0

5 years ago

0.31.10

5 years ago

0.31.9

5 years ago

0.31.6

5 years ago

0.31.0

5 years ago

0.30.0

5 years ago

0.29.0

5 years ago

0.28.2

5 years ago

0.28.0

5 years ago

0.26.4

5 years ago

0.25.2

5 years ago

0.24.1

5 years ago

0.24.0

5 years ago

0.22.1

5 years ago

0.20.15

5 years ago

0.20.11

5 years ago

0.20.8

5 years ago

0.20.4

5 years ago

0.20.3

5 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago