Skip to content

Commit

Permalink
feat(segment): add destination filters (#5197)
Browse files Browse the repository at this point in the history
### Description

Enables the use of [destination
filters](https://docs.segmentapis.com/tag/Destination-Filters/) with
Segment.

### Test plan

- [x] Test filters locally on Alfajores.

### Related issues

- Fixes ACT-1115

### Backwards compatibility

Yes

### Network scalability

N/A
  • Loading branch information
MuckT committed Apr 2, 2024
1 parent fc3f2f2 commit 31d134d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"@segment/analytics-react-native": "^2.19.1",
"@segment/analytics-react-native-plugin-adjust": "^0.7.0",
"@segment/analytics-react-native-plugin-clevertap": "^1.1.0",
"@segment/analytics-react-native-plugin-destination-filters": "^1.1.0",
"@segment/analytics-react-native-plugin-firebase": "^0.4.1",
"@segment/sovran-react-native": "^1.1.1",
"@sentry/react-native": "^4.15.2",
Expand Down
2 changes: 2 additions & 0 deletions src/analytics/ValoraAnalytics.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createClient, SegmentClient } from '@segment/analytics-react-native'
import { AdjustPlugin } from '@segment/analytics-react-native-plugin-adjust'
import { ClevertapPlugin } from '@segment/analytics-react-native-plugin-clevertap'
import { DestinationFiltersPlugin } from '@segment/analytics-react-native-plugin-destination-filters'
import { FirebasePlugin } from '@segment/analytics-react-native-plugin-firebase'
import { sha256FromString } from 'ethereumjs-util'
import _ from 'lodash'
Expand Down Expand Up @@ -112,6 +113,7 @@ class ValoraAnalytics {
storePersistor: AsyncStoragePersistor,
})

this.segmentClient.add({ plugin: new DestinationFiltersPlugin() })
this.segmentClient.add({ plugin: new InjectTraits() })
this.segmentClient.add({ plugin: new AdjustPlugin() })
this.segmentClient.add({ plugin: new ClevertapPlugin() })
Expand Down
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3256,6 +3256,14 @@
resolved "https://registry.yarnpkg.com/@segment/analytics-react-native-plugin-clevertap/-/analytics-react-native-plugin-clevertap-1.1.0.tgz#0047c1875582141424552a80a24e8daa9a69035f"
integrity sha512-D/lypeLxR9o53U9MzmgsGEY4yIr1oCINY5uBwmWELfgdFwxAx+5aiRnGzdLm3v7kQl+8nfFwaNMdkq/tGzZMRw==

"@segment/analytics-react-native-plugin-destination-filters@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@segment/analytics-react-native-plugin-destination-filters/-/analytics-react-native-plugin-destination-filters-1.1.0.tgz#b7ba154ed3965637b2983f07b210df05d02a8dc3"
integrity sha512-q3vPwC7LK3hkNVkjgerK8xVBMjZMeu43eirs84dtSCueZt06e/RrGeZIIBqguyQVpoBHF8KNdEhN2gB9+fNBow==
dependencies:
"@segment/tsub" "^2"
clone "^2.1.2"

"@segment/analytics-react-native-plugin-firebase@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@segment/analytics-react-native-plugin-firebase/-/analytics-react-native-plugin-firebase-0.4.1.tgz#b08816e8e875dde7bd4cb9e43ca72cf7d8034bb1"
Expand Down Expand Up @@ -7187,6 +7195,11 @@ clone@^1.0.2:
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4=

clone@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==

co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
Expand Down

0 comments on commit 31d134d

Please sign in to comment.