{"id":30312705,"url":"https://github.com/mparticle/data-planning-node","last_synced_at":"2025-08-17T17:14:21.141Z","repository":{"id":41985672,"uuid":"236028790","full_name":"mParticle/data-planning-node","owner":"mParticle","description":"mParticle SDK for Data Master","archived":false,"fork":false,"pushed_at":"2025-08-07T22:13:02.000Z","size":1295,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-08T19:54:09.605Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mParticle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.MD","contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-24T15:31:53.000Z","updated_at":"2024-06-18T07:11:30.000Z","dependencies_parsed_at":"2023-10-12T05:41:24.417Z","dependency_job_id":"10aef0eb-c391-43e3-b35a-caaccae03da5","html_url":"https://github.com/mParticle/data-planning-node","commit_stats":{"total_commits":58,"total_committers":4,"mean_commits":14.5,"dds":"0.43103448275862066","last_synced_commit":"811e74581d4276de452c47375221107cf3d4adea"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/mParticle/data-planning-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mParticle%2Fdata-planning-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mParticle%2Fdata-planning-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mParticle%2Fdata-planning-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mParticle%2Fdata-planning-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mParticle","download_url":"https://codeload.github.com/mParticle/data-planning-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mParticle%2Fdata-planning-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270877420,"owners_count":24661138,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-08-17T17:14:20.018Z","updated_at":"2025-08-17T17:14:21.122Z","avatar_url":"https://github.com/mParticle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://static.mparticle.com/sdk/mp_logo_black.svg\" width=\"280\"\u003e\u003cbr\u003e\n\n[![npm](https://img.shields.io/npm/v/@mparticle/data-planning-node.svg?maxAge=2592000)](https://www.npmjs.com/package/@mparticle/data-planning-node)\n\n# mParticle Data Planning Node SDK\n\nHello! This is the public repo of the mParticle Web Data Planning SDK. We've built the mParticle platform to take a new approach to web and mobile app data and the platform has grown to support 200+ services and SDKs, including developer tools, analytics, attribution, messaging, and advertising services. mParticle is designed to serve as the connector between all of these services - check out [our site](http://mparticle.com), or hit us at developers@mparticle.com to learn more.\n\n## Documentation\n\nFully detailed documentation and other information about mParticle web SDK can be found at our doc site\n\n-   [Core mParticle SDK](https://docs.mparticle.com/developers/sdk/web/getting-started)\n\n# Overview\n\nThe main purpose of this project is to validate your customer data before it arrives at mParticle's systems. In simplest terms, a Data Plan represents the contract between your data and mParticle.\n\nThis project allows the fetching of Data Plans or Data Plan Versions and the ability to validate your events and batches against said Data Plan Versions.\n\n# Getting Started\n\n## Importing Data Planning Node\n\n`$ npm install @mparticle/data-planning-node`\n\nTo use this within your project:\n\n```typescript\nimport { DataPlanService } from '@mparticle/data-planning-node';\n```\n\n## Fetching Data Plans\n\nTo fetch a Data Plan or Data Plan Version, you will first need the following credentials:\n\n-   Organization ID\n-   Workspace ID\n-   Account ID\n-   Bearer Token from [Platform API](https://docs.mparticle.com/developers/platform/#authentication)\n\n```typescript\nimport { DataPlanService } from '@mparticle/data-planning-node';\n\nconst dataPlanService = new DataPlanService();\n\n// Fetch full data plan\ndataPlanService\n    .getPlan(\u003corganizationId\u003e,\u003caccountId\u003e, \u003cdataPlanId\u003e, \u003cworkspaceId\u003e, \u003ctoken\u003e)\n    .then(dataPlan =\u003e {\n        // Save or render your data plan\n    });\n\n// Fetch Data Plan Version\ndataPlanService\n    .getVersionDocument(\u003corganizationId\u003e, \u003caccountId\u003e, \u003cdataPlanId\u003e, \u003cworkspaceId\u003e, \u003cversionNumber\u003e, \u003ctoken\u003e)\n    .then(dataPlanVersion =\u003e {\n        // Save or render your data plan version\n    });\n\n```\n\n## Validating Data\n\nTo validate your event or batch, you should use the `validateEvent`, `validateEvents`, or `validateBatch` methods, respectively.\n\n```typescript\nimport { DataPlanService } from '@mparticle/data-planning-node';\n\nconst dataPlanService = new DataPlanService();\n\n// Fetch Data Plan Version asynchronously\nconst dataPlanVersion = await dataPlanService\n    .getVersionDocument(\u003corganizationId\u003e, \u003caccountId\u003e, 'my_custom_data_plan, \u003cworkspaceId\u003e, 3, \u003ctoken\u003e);\n\nconst batchValidationResults = dataPlanService.validateBatch(batch, dataPlanVersion.version_document);\n\nconst eventValidationResults = dataPlanService.validateEvent(event, dataPlanVersion.version_document);\n\n```\n\n### Validation Result Sample\n\n```\nresults: [\n    {\n        data: {\n            match: {\n                type: 'screen_view',\n                criteria: {\n                    screen_name: 'Test Screen View',\n                },\n            },\n            validation_errors: [\n                {\n                    error_pointer: '#/data',\n                    key: 'data',\n                    expected: 'custom_flags',\n                    schema_keyword: 'required',\n                    validation_error_type: 'missing_required',\n                },\n            ],\n        },\n        event_type: 'validation_result',\n    },\n],\n```\n\n# Contribution Guidelines\n\nAt mParticle, we are proud of our code and like to keep things open source. If you'd like to contribute, simply fork this repo, push any code changes to your fork, and submit a Pull Request against the `master` branch of mParticle-web-media-sdk.\n\n## Running the Tests\n\nPrior to running the tests please install all dev dependencies via an `npm install`, and build the mParticle.js file as well as the test file by running `npm run build`:\n\n```bash\n$ npm install\n$ npm run build\n$ npm test\n```\n\nThe test script will run all tests using Mocha as unit tests.\n\n## Development Notes\n\nThis package comes with the NPM package [pre-commit](https://www.npmjs.com/package/pre-commit), which will run [GTS](https://github.com/google/gts) when you try to commit.\n\n## Support\n\n\u003csupport@mparticle.com\u003e\n\n## License\n\nThe mParticle Web Media SDK is available under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmparticle%2Fdata-planning-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmparticle%2Fdata-planning-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmparticle%2Fdata-planning-node/lists"}