Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 7116d40 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
e313647 to
e030925
Compare
e030925 to
9a8e8c0
Compare
9a8e8c0 to
04b42ea
Compare
4493dae to
e5b3335
Compare
matthewvolk
left a comment
There was a problem hiding this comment.
Looks good, just want to make sure that if someone changes the default cookie name to match stencil, the crossSubdomain property doesn't cause spooky behavior
| analyticsConsent: consent?.['c.measurement'] ?? false, | ||
| functionalConsent: consent?.['c.functionality'] ?? false, | ||
| targetingConsent: consent?.['c.marketing'] ?? false, |
There was a problem hiding this comment.
🍹 Is there a good reason to mix dot and bracket property accessors like this?
There was a problem hiding this comment.
Just not possible with the way the cookie schema is defined
| mode: 'offline', | ||
| storageConfig: { | ||
| storageKey: CONSENT_COOKIE_NAME, | ||
| crossSubdomain: true, |
There was a problem hiding this comment.
Enabling cross-subdomain doesn't interfere with consent cookie names that may be set on the hosted checkout, does it?
There was a problem hiding this comment.
Per an offline conversation, it could conflict but cookie names are different so it should be fine.
| const baseConfig: C15tScript = { | ||
| category: mapConsentCategory(script.consentCategory), | ||
| id: script.entityId, | ||
| target: script.location === 'HEAD' ? 'head' : 'body', |
There was a problem hiding this comment.
👏 Awesome that we support this now. Maybe you already mentioned it to Chris on the call we had, but we should include in the release notes since the last release notes mentioned this feature was coming soon
There was a problem hiding this comment.
Technically it's not rendered in the footer but I believe the behavior works as expected (priority loading).
| @@ -0,0 +1,25 @@ | |||
| /** | |||
| * Parses the compact format: i.t:1765485149496,c.necessary:1,c.functionality:1,etc. | |||
There was a problem hiding this comment.
Ah... maybe this is the answer to my previous comment about property accessors
There was a problem hiding this comment.
Yes, c.necessary is the key
e5b3335 to
7116d40
Compare
What/Why?
Upgrade c15t to 1.8.2, migrate from custom mode to offline mode, refactor consent cookie handling to use c15t's compact format, add script location support for HEAD/BODY rendering, and add privacy policy link support to CookieBanner.
What Changed
@c15t/nextjsto version1.8.2custom(with endpoint handlers) toofflinemodehandlers.tsimplementationenabledprop toC15TConsentManagerProviderto control consent manager functionalitydecoder.ts,encoder.ts)parse-compact-format.tsto handle c15t's compact cookie formati.t:timestamp,c.necessary:1,c.functionality:1,etc...locationfield from BigCommerce API and can be rendered in<head>or<body>based on thetargetpropertyCookieBannernow supports theprivacyPolicyUrlfield from BigCommerce API and will be rendered in the banner description if available.Testing
Kapture.2025-12-12.at.11.07.17.mp4
Privacy Policy
Migration
Consent Manager Provider Changes
The
ConsentManagerProvidernow usesofflinemode instead ofcustommode with endpoint handlers. The provider configuration has been simplified:Before:
After:
Key changes:
modechanged from'custom'to'offline'endpointHandlers- no longer needed in offline modeenabledprop to control consent manager functionalitystorageConfigfor cookie storage configurationCookie Handling
If you have custom code that directly reads or writes consent cookies, you'll need to update it:
Before:
The previous implementation used custom encoding/decoding. If you were directly accessing consent cookie values, you would have needed to use the custom decoder.
After:
The consent cookie now uses c15t's compact format. The public API for reading cookies remains the same:
The
getConsentCookie()function now internally usesparseCompactFormat()to parse the compact format cookie string. If you were directly parsing cookie values, you should now use thegetConsentCookie()helper instead.getConsentCookienow returns a compact version of the consent values:Updated instances where
getConsentCookieis used to reflect this new schema.Removed
setConsentCookiefrom server and client since this is now handled by the c15t library.Script Location Support
Scripts now support rendering in either
<head>or<body>based on thelocationfield from the BigCommerce API:The
ScriptsFragmentGraphQL query now includes thelocationfield, allowing scripts to be placed in the appropriate DOM location.FOOTERlocation is still not supported.Privacy Policy
The
RootLayoutMetadataQueryGraphQL query now includes theprivacyPolicyUrlfield, which renders a provicy policy link in theCookieBannerdescription.The privacy policy link:
target="_blank")privacyPolicyUrlis provided as a non-empty stringAdd translatable
privacyPolicyfield toComponents.ConsentManager.CookieBannertranslation namespace for the privacy policy link text.