Skip to content

Commit

Permalink
feat: integrate database encryption as a plugin (#261)
Browse files Browse the repository at this point in the history
* feat(rudder-plugin-db-encryption-react-native): add dbEncryption plugin

* feat(rudder-sdk-react-native): add dbEncryption support

* chore(rudder-sdk-react-native-monorepo): add dbEncryption plugin

* chore(example): add dbEncryption plugin

* chore(example): update podfile.lock

* chore(rudder-sdk-react-native): update the minimum rudder ios dependency to v1.23.0

* chore(rudder-plugin-db-encryption-react-native): update the minimum rudder ios dependency to v1.23.0

* chore(rudder-sdk-react-native-monorepo): update CONTRIBUTING steps

* chore(rudder-plugin-db-encryption-react-native): fix the plugin version in project.json file

* chore(rudder-plugin-db-encryption-react-native): set the release as major in project.json

* chore(rudder-sdk-react-native-monorepo): update readme
  • Loading branch information
1abhishekpandey authored Oct 16, 2023
1 parent 0fb4571 commit d798eee
Show file tree
Hide file tree
Showing 54 changed files with 1,492 additions and 1,123 deletions.
29 changes: 15 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,25 @@ For more information on the different ways in which you can contribute to Rudder
We prefer squash or rebase commits so that all changes from a branch are committed to master as a single commit. All pull requests are squashed when merged, but rebasing prior to merge gives you better control over the commit message.

## Conventional commit messages format for React-Native monorepo

To maintain consistency and provide clear information about the nature of commits, it is essential to follow conventional commit messages. The commit message format should adhere to `<type>(scope): <description>`, and you can find more details about it [here](https://www.conventionalcommits.org/en/v1.0.0/). By following this format, you ensure that commit messages are structured and convey the necessary information effectively.

List of React-Native packages and their corresponding commit message format:

| React Native packages | Fix commit message format | Feature commit message format |
|----------------------------------------------|---------------------|------------------------|
| rudder-sdk-react-native | fix(rudder-sdk-react-native): fix some issue | feat(rudder-sdk-react-native): add some new feature |
| rudder-integration-amplitude-react-native | fix(rudder-integration-amplitude-react-native): fix some issue | feat(rudder-integration-amplitude-react-native): add some new feature |
| rudder-integration-appcenter-react-native | fix(rudder-integration-appcenter-react-native): fix some issue | feat(rudder-integration-appcenter-react-native): add some new feature |
| rudder-integration-appsflyer-react-native | fix(rudder-integration-appsflyer-react-native): fix some issue | feat(rudder-integration-appsflyer-react-native): add some new feature |
| rudder-integration-braze-react-native | fix(rudder-integration-braze-react-native): fix some issue | feat(rudder-integration-braze-react-native): add some new feature |
| rudder-integration-clevertap-react-native | fix(rudder-integration-clevertap-react-native): fix some issue | feat(rudder-integration-clevertap-react-native): add some new feature |
| rudder-integration-firebase-react-native | fix(rudder-integration-firebase-react-native): fix some issue | feat(rudder-integration-firebase-react-native): add some new feature |
| rudder-integration-moengage-react-native | fix(rudder-integration-moengage-react-native): fix some issue | feat(rudder-integration-moengage-react-native): add some new feature |
| rudder-integration-singular-react-native | fix(rudder-integration-singular-react-native): fix some issue | feat(rudder-integration-singular-react-native): add some new feature |
| example | fix(example): fix some issue | feat(example): add some new feature |
| rudder-sdk-react-native-monorepo | fix(rudder-sdk-react-native-monorepo): fix some issue | feat(rudder-sdk-react-native-monorepo): add some new feature |
| React Native packages | Fix commit message format | Feature commit message format |
| ----------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------- |
| rudder-sdk-react-native | fix(rudder-sdk-react-native): fix some issue | feat(rudder-sdk-react-native): add some new feature |
| rudder-integration-amplitude-react-native | fix(rudder-integration-amplitude-react-native): fix some issue | feat(rudder-integration-amplitude-react-native): add some new feature |
| rudder-integration-appcenter-react-native | fix(rudder-integration-appcenter-react-native): fix some issue | feat(rudder-integration-appcenter-react-native): add some new feature |
| rudder-integration-appsflyer-react-native | fix(rudder-integration-appsflyer-react-native): fix some issue | feat(rudder-integration-appsflyer-react-native): add some new feature |
| rudder-integration-braze-react-native | fix(rudder-integration-braze-react-native): fix some issue | feat(rudder-integration-braze-react-native): add some new feature |
| rudder-integration-clevertap-react-native | fix(rudder-integration-clevertap-react-native): fix some issue | feat(rudder-integration-clevertap-react-native): add some new feature |
| rudder-integration-firebase-react-native | fix(rudder-integration-firebase-react-native): fix some issue | feat(rudder-integration-firebase-react-native): add some new feature |
| rudder-integration-moengage-react-native | fix(rudder-integration-moengage-react-native): fix some issue | feat(rudder-integration-moengage-react-native): add some new feature |
| rudder-integration-singular-react-native | fix(rudder-integration-singular-react-native): fix some issue | feat(rudder-integration-singular-react-native): add some new feature |
| example | fix(example): fix some issue | feat(example): add some new feature |
| rudder-sdk-react-native-monorepo | fix(rudder-sdk-react-native-monorepo): fix some issue | feat(rudder-sdk-react-native-monorepo): add some new feature |
| rudder-plugin-db-encryption-react-native | fix(rudder-plugin-db-encryption-react-native): fix some issue | feat(rudder-plugin-db-encryption-react-native): add some new feature |

You may also use `chore` and other commit types as described in the [**Conventional Commit**](https://www.conventionalcommits.org/en/v1.0.0/) documentation. But only `fix` and `feat` commits will be considered for changelog generation.

Expand All @@ -58,7 +60,6 @@ For any questions, concerns, or queries, you can start by asking a question on o

### We look forward to your feedback on improving this project!


<!----variables---->

[issue]: https://github.com/rudderlabs/rudder-sdk-react-native/issues/new/choose
Expand Down
33 changes: 0 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,39 +111,6 @@ Example Usage:
rudderClient.setAnonymousId(ANONYMOUS_ID);
```

## Database Encryption

To encrypt the database first add the below line to `import` the rudderClient and DBEncryption.

```
import rudderClient, { RUDDER_LOG_LEVEL, DBEncryption } from '@rudderstack/rudder-sdk-react-native';
```

Then open your `app/build.gradle` and add the dependency under `dependencies` as shown below:

```
//sql-cipher
implementation "net.zetetic:android-database-sqlcipher:4.5.4"
implementation "androidx.sqlite:sqlite:2.3.1"
```

Add the following code in your application:

```
const dbEncryption = new DBEncryption('versys', true);
const config = {
dataPlaneUrl: <DATA_PLANE_URL>,
trackAppLifecycleEvents: true,
logLevel: RUDDER_LOG_LEVEL.DEBUG,
dbEncryption: dbEncryption,
};
await rudderClient.setup(<WRITE_KEY>, config);
```

This feature is supported starting from version `1.9.0` of the SDK.

For more details, check out our [documentation](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-react-native-sdk).

## Contact Us
Expand Down
4 changes: 0 additions & 4 deletions apps/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ dependencies {
implementation 'com.moengage:moe-android-sdk:10.6.01'
// Firebase
implementation 'com.google.firebase:firebase-messaging:21.0.0'

//sql-cipher
implementation "net.zetetic:android-database-sqlcipher:4.5.4"
implementation "androidx.sqlite:sqlite:2.3.1"
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Loading

0 comments on commit d798eee

Please sign in to comment.