{"id":21882394,"url":"https://github.com/essent/nativescript-salesforce-dmp","last_synced_at":"2026-05-10T02:09:49.583Z","repository":{"id":56658230,"uuid":"129413217","full_name":"Essent/nativescript-salesforce-dmp","owner":"Essent","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-26T20:10:07.000Z","size":3829,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-26T18:46:46.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Essent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-13T14:26:25.000Z","updated_at":"2018-12-03T13:39:29.000Z","dependencies_parsed_at":"2022-08-15T22:41:01.975Z","dependency_job_id":null,"html_url":"https://github.com/Essent/nativescript-salesforce-dmp","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Essent/nativescript-salesforce-dmp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-salesforce-dmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-salesforce-dmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-salesforce-dmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-salesforce-dmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Essent","download_url":"https://codeload.github.com/Essent/nativescript-salesforce-dmp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Essent%2Fnativescript-salesforce-dmp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263247625,"owners_count":23436877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T09:28:57.677Z","updated_at":"2026-05-10T02:09:49.531Z","avatar_url":"https://github.com/Essent.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeScript plugin for Salesforce DMP\n\n[![npm version](https://badge.fury.io/js/%40essent%2Fnativescript-salesforce-dmp.svg)](https://www.npmjs.com/package/@essent/nativescript-salesforce-dmp)\n\nThis is a plugin to use the Salesforce DMP SDK ([Android](https://konsole.zendesk.com/hc/en-us/articles/226031268-Android-SDK-Implementation-Guide) v4.3.2, [iOS](https://konsole.zendesk.com/hc/en-us/articles/219986988-iOS-SDK-Implementation-Guide) v4.3.0). To use this plugin you need to have an account for Salesforce DMP.\n\n## Installation\n\nRun the following command from the root of your project:\n```console\ntns plugin add @essent/nativescript-salesforce-dmp\n```\n\n## Setup (Android Only)\n\nMake sure you add the following permissions to the AndroidManifest.xml file of your app:\n```xml\n\u003cuses-permission android:name=\"android.permission.INTERNET\"/\u003e\n\u003cuses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/\u003e\n```\n\nAdd the following services to the application tag in the AndroidManifest.xml file of your app ([example](./demo/app/App_Resources/Android/AndroidManifest.xml)):\n```xml\n\u003cservice android:name=\"com.krux.androidsdk.aggregator.EventPublisherService\" android:enabled=\"true\" /\u003e\n\u003cservice android:name=\"com.krux.androidsdk.aggregator.ConsentService\" android:enabled=\"true\" /\u003e\n```\n\nAdd play-services-ads to the dependencies in the app.gradle file of your app ([example](./demo/app/App_Resources/Android/app.gradle)):\n```gradle\ncompile 'com.google.android.gms:play-services-ads:10.2.4'\n```\n\n## Usage\n\nTo use nativescript-salesforce-dmp you must first import the module:\n```ts\nimport { SalesforceDMP, KeyValue } from '@essent/nativescript-salesforce-dmp';\n```\n\nAt the launch of your app call `initialize` with your config id:\n```ts\nSalesforceDMP.getInstance().initialize('YOUR_CONFIG_ID', true);\n```\n\n### Consent\n\nBefore using Salesforce DMP the user needs to give consent. More information about these flags can be found in [this support article](https://konsole.zendesk.com/hc/en-us/articles/360000486853-Consumer-Rights-Management-Concepts-Glossary-of-Terms).  \nTo set the consent:\n```ts\nconst consentAttributes: KeyValue\u003cstring\u003e = {\n    pr: '1',\n    dc: '1',\n    al: '1',\n    tg: '1',\n    cd: '1',\n    sh: '0',\n    re: '1'\n};\nSalesforceDMP.getInstance().setConsent(consentAttributes);\n```\n\nTo quickly remove all consent flags:\n```ts\nSalesforceDMP.getInstance().removeConsent();\n```\n\n### Tracking\n\nTo track page views call `trackPageView` (optionally you can use pageAttributes and userAttributes):\n```ts\nSalesforceDMP.getInstance().trackPageView('TestPage', null, null);\n```\n\nTo fire events call `fireEvent`:\n```ts\nconst attributes: KeyValue\u003cstring\u003e = {\n    event_id: 'YOUR_EVENT_ID', // this attribute is mandatory\n    myKey: 'An event value'\n};\nSalesforceDMP.getInstance().fireEvent('TestEvent', attributes);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessent%2Fnativescript-salesforce-dmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fessent%2Fnativescript-salesforce-dmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessent%2Fnativescript-salesforce-dmp/lists"}