-
Notifications
You must be signed in to change notification settings - Fork 254
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
ShopifyCustomerPrivacy fixes and improvements #2103
Conversation
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
Yes, the args to
Do not use the shorthard ( |
This comment has been minimized.
This comment has been minimized.
packages/hydrogen/src/customer-privacy/ShopifyCustomerPrivacy.tsx
Outdated
Show resolved
Hide resolved
b96a4e9
to
e9b5a19
Compare
console.error( | ||
`[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token`, | ||
); | ||
console; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this Line 159: console;
an accidental commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhh no, merged too early. will open another PR
These are some fixes and optimizations based on a 3P consent implementation.
[x] Add validation and error logging to ensure
conset.storefrontAccessToken
is a valid public token and not a server token[x] Add an explicit return type of
CustomerPrivacy | null
togetCustomerPrivacy
[x] Add a type of
(data: {error: string} | undefined) => void
to thesetTrackingConsent
callback[x] Fix the
VisitorConsent
type to expectBoolean
values instead of"true"
,"false"
strings. While implementing a 3P consent sync with Shopify, we noticed thatsale_of_data
must be aboolean
orsetTrackingConsent
would error. @alejandro-shopify could you confirm that these can bebooleans
? CC @wizardlyhel