Skip to content

Commit

Permalink
Merge pull request #20 from coinbase/add_tracker
Browse files Browse the repository at this point in the history
Include trackerMatches in the list of exported methods
  • Loading branch information
joshuaostrom-cb authored Jul 17, 2024
2 parents c27a9a2 + 7679fc8 commit d572a14
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@coinbase/cookie-banner": "1.0.4",
"@coinbase/cookie-manager": "1.1.5",
"@coinbase/cookie-manager": "1.1.6",
"next": "14.1.1",
"react": "^18",
"react-dom": "^18"
Expand Down
2 changes: 1 addition & 1 deletion packages/cookie-banner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"react-dom": "^18.1.0"
},
"dependencies": {
"@coinbase/cookie-manager": "^1.1.5",
"@coinbase/cookie-manager": "^1.1.6",
"react-intl": "^6.5.1",
"styled-components": "^5.3.6"
}
Expand Down
4 changes: 4 additions & 0 deletions packages/cookie-manager/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.6 (07/17/2024)

- Include trackerMatches in the list of exported methods

## 1.1.5 (06/12/2024)

- Added support for initialCookieValues, initialGPCValue
Expand Down
22 changes: 22 additions & 0 deletions packages/cookie-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,28 @@ const SomeComponent = () => {
}
```
### trackerMatches
Used for determining if the passed value matches the tracker criteria.
This will match the if the value or regex produces a match on the passed value
Example usage:
```typescript
import { trackerMatches } from '@coinbase/cookie-manager';

const tracker: Tracker = {
id: 'id-regex',
type: TrackerType.COOKIE,
regex: 'id(?:_[a-f0-9]{32}|undefined)(?:.*)',
};

trackerMatches(tracker, 'id_ac7a5c3da45e3612b44543a702e42b01')
```
## License
Licensed under the Apache License. See [LICENSE](./LICENSE.md) for more information.
2 changes: 1 addition & 1 deletion packages/cookie-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/cookie-manager",
"version": "1.1.5",
"version": "1.1.6",
"description": "Coinbase Cookie Manager",
"main": "dist/index.js",
"license": "Apache-2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/cookie-manager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export {
getAppTrackingTransparencyFromQueryParams,
persistMobileAppPreferences,
} from './utils/persistMobileAppPreferences';
export { default as trackerMatches } from './utils/trackerMatches';

0 comments on commit d572a14

Please sign in to comment.