x

discord

github1.3k
3.1 min read
canaryCanary

v1.8.0 - Cross-Subdomain Consent, Legal Links, User Identification & 27 Languages

Posted By

Kaylee
consent-icon-rounded

✨ New Features

This update changes how we store consent in the browser, from using local-storage only to a hybrid approach with both cookies & local storage.

Cookies will now allow you to check consent on the server side & persist consent across subdomains e.g. dashboard.example.com & example.com.

To enable this, you use the storageConfig option.

<ConsentManagerProvider
  options={{
    storageConfig: {
      storageKey: 'my-consent', // Custom override for local storage + cookie key 
      crossSubdomain: true,
    },
  }}
>

Existing consent under the old privacy-consent-storage key will be automatically migrated to the new c15t key.

You can now add various legal links to the consent manager. This can be used to display links in the consent banner, dialog, etc.

<ConsentManagerProvider
  options={{
    legalLinks: {
      privacyPolicy: { href: '/privacy-policy' },
      termsOfService: { href: '/terms-of-service' },
      cookiePolicy: { href: '/cookie-policy' },
    },
  }}
>

You can filter what legal links you want to display (if any) on the pre-made components by passing the legalLinks prop.

// Show all legal links
<CookieBanner />

// Show both cookie policy and terms of service
<CookieBanner legalLinks={['cookiePolicy', 'termsOfService']} />

// Show no legal links
<CookieBanner legalLinks={null} />

TODO: INSERT IMAGE HERE

User Identification

We've enabled user identification in the consent manager. This allows you to link a user's ID to a consent record both before & after consent is given.

An external ID can be set in various ways:

<ConsentManagerProvider
  options={{
    user: {
      id: 'usr_foobar',
      identityProvider: 'better-auth',
    }
  }}
>

// Or via the `identifyUser` method in the Store
const { identifyUser } = useConsentManager();

identifyUser({
  id: 'usr_foobar',
  identityProvider: 'better-auth',
});

This change also brings a new endpoint to the backend: PATCH /consent/identify. So you'll need to update your backend to support this new endpoint.

All 24 Official Languages of the European Union

We've added support for all 24 official languages of the European Union to the translations package bringing the total number of supported languages to 27.

Current languages include:

Bulgarian (bg)Czech (cs)Danish (da)German (de)Greek (el)English (en)Spanish (es)
Estonian (et)Finnish (fi)French (fr)Irish (ga)Hebrew (he)Croatian (hr)Hungarian (hu)
Indonesian (id)Italian (it)Lithuanian (lt)Latvian (lv)Maltese (mt)Dutch (nl)Polish (pl)
Portuguese (pt)Romanian (ro)Slovak (sk)Slovenian (sl)Swedish (sv)Chinese (zh)

🐛 Bug Fixes & Improvements

@c15t/scripts

  • Added new Databuddy prebuilt script
  • Updated dependencies

@c15t/nextjs

  • Ensure all exports from core are re-exported
  • Updated dependencies

@c15t/react

  • Ensure all exports from core are re-exported
  • Updated dependencies

c15t

  • Updated dependencies

@c15t/translations

  • Updated dependencies

@c15t/scripts

  • Updated dependencies

@c15t/cli

  • Updated dependencies

@c15t/backend

  • Updated dependencies

@c15t/node-sdk

  • Updated dependencies

@c15t/dev-tools

  • Updated dependencies

Thank you to our contributors

, , , ,

c15t