Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Use new default consentCollectorApiUrl with a new resource type #403

Open
wants to merge 1 commit into
base: release/v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ initCookieConsentManager( // when loaded as a module, these options are passed t
| `autodetectLang` | boolean | `true` | Autodetect language based on the value of `<html lang="...">`. If autodetect fails or if unsupported language is detected, fallback to `defaultLang`.<br>When disabled, force language to `defaultLang`. |
| `defaultLang` | string | `'cs'` | Default language. One of `cs`, `de`, `en`, `hu`, `pl`, `ru`, `sk`, `uk`. This language will be used when autodetect is disabled or when it fails. |
| `companyNames` | array | `['Alma Career']` | Array of strings with company names. Adjust only when the consent needs to be given to multiple companies. Value "Alma Career" is replaced with translated legal name. [See example][examples-configuration]. |
| `consentCollectorApiUrl` | ?string | `'https://ccm.lmc.cz/(...)'` | URL of the API where user consent information is sent. Null to disable sending data to the API. |
| `consentCollectorApiUrl` | ?string | `'https://consents.almacareer.tech/acl-lda/(...)'` | URL of the API where user consent information is sent. Null to disable sending data to the API. |
| `config` | Object | `{}` | Override internal config of the underlying library. For all parameters see [config reference of the original library][cookie consent options]. |
| `displayMode` | DisplayMode (string) | `DisplayMode.FORCE` (`force`) | `force` (default) to show consent in a centered modal box and to block page until user action. `soft` to show consent banner on the bottom of the page and do not block the page before user action. |
| `on*` callbacks | function | `(cookieConsent) => {}` | See below for configurable callbacks. |
Expand Down
2 changes: 1 addition & 1 deletion examples/callbacks.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h2 class="mt-md-3 mb-3">onChange callback – dump of <code>categories</code> p
window.ccm = initCookieConsentManager( // note we store cookieConsent instance in global window.ccm variable
'github.example',
{
consentCollectorApiUrl: 'https://ccm.lmc.cz/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
consentCollectorApiUrl: 'https://consents.almacareer.tech/acl-lda/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
displayMode: 'soft', // show consent in a bottom banner and do not force user action before page could be used
onConsent: ({cookieConsent}) => { // any type of consent detected (including only necessary, custom selection or all categories)
markCallbackCalled('onConsent');
Expand Down
2 changes: 1 addition & 1 deletion examples/configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h2 class="mt-md-3 mb-3">Use cookieConsent instance</h2>
defaultLang: 'sk', // force use of 'sk' language instead
displayMode: 'force', // show consent in a blocking modal window (this is also default)
companyNames: ['Alma Career', 'Some Other Company', 'ACME'], // define custom company names to be shown in the consent text
consentCollectorApiUrl: 'https://ccm.lmc.cz/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
consentCollectorApiUrl: 'https://consents.almacareer.tech/acl-lda/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
config: { // override default config of the underlying library, see https://cookieconsent.orestbida.com/reference/configuration-reference.html
manageScriptTags: false, // disable management of <script> attributes, see https://github.com/lmc-eu/cookie-consent-manager#third-party-scripts-loaded-via-script
cookie: {
Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h2 class="mt-4 mt-md-5 mb-3">Content set using inline <code>&lt;script&gt;</cod
initCookieConsentManager(
'github.example',
{
consentCollectorApiUrl: 'https://ccm.lmc.cz/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
consentCollectorApiUrl: 'https://consents.almacareer.tech/acl-lda/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
displayMode: 'soft', // show consent in a bottom banner and do not force user action before page could be used
onConsent: ({ cookieConsent }) => { // any type of consent detected (including only necessary, custom selection or all categories)
if (cookieConsent.acceptedCategory('ad')) {
Expand Down
2 changes: 1 addition & 1 deletion examples/languages.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h2 class="mt-md-3 mb-3">Select language</h2>
defaultLang: 'cs',
displayMode: 'soft', // show consent in a bottom banner and do not force user action before page could be used
companyNames: ['Alma Career', 'Some Other Company', 'ACME'],
consentCollectorApiUrl: 'https://ccm.lmc.cz/local-data-acceptation-data-entries?Spot=(public,demo)',
consentCollectorApiUrl: 'https://consents.almacareer.tech/acl-lda/local-data-acceptation-data-entries?Spot=(public,demo)',
onConsent: () => document.getElementById('reset').removeAttribute('hidden'), // reveal Reset cookie button
}
);
Expand Down
2 changes: 1 addition & 1 deletion examples/theming.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ <h2 class="mt-4 mt-md-5 mb-3">Without Spirit Design System</h2>
initCookieConsentManager(
'github.example',
{
consentCollectorApiUrl: 'https://ccm.lmc.cz/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
consentCollectorApiUrl: 'https://consents.almacareer.tech/acl-lda/local-data-acceptation-data-entries?Spot=(public,demo)', // override default URL for demo purposes; do not set custom consentCollectorApiUrl unless you have been explicitly guided to do so!
displayMode: 'soft', // show consent in a bottom banner and do not force user action before page could be used
onConsent: () => document.getElementById('reset').removeAttribute('hidden'), // reveal Reset cookie button
}
Expand Down
2 changes: 1 addition & 1 deletion src/CookieConsentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const noopChangeCallback: OnChangeCallback = () => {};
const defaultOptions: CookieConsentManagerOptions = {
defaultLang: 'cs',
autodetectLang: true,
consentCollectorApiUrl: 'https://ccm.lmc.cz/local-data-acceptation-data-entries',
consentCollectorApiUrl: 'https://consents.almacareer.tech/acl-lda/local-data-acceptation-data-entries',
onFirstConsent: noopConsentCallback,
onConsent: noopConsentCallback,
onChange: noopChangeCallback,
Expand Down
Loading