{"id":19411576,"url":"https://github.com/volcengine/datarangers-sdk-mp","last_synced_at":"2025-04-14T11:07:46.687Z","repository":{"id":89229277,"uuid":"515079702","full_name":"volcengine/datarangers-sdk-mp","owner":"volcengine","description":"SDK in miniprogram for datarangers products","archived":false,"fork":false,"pushed_at":"2023-01-03T11:24:21.000Z","size":105,"stargazers_count":2,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T11:07:42.799Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/volcengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2022-07-18T07:32:31.000Z","updated_at":"2025-02-18T11:07:32.000Z","dependencies_parsed_at":"2023-06-14T12:30:17.015Z","dependency_job_id":null,"html_url":"https://github.com/volcengine/datarangers-sdk-mp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatarangers-sdk-mp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatarangers-sdk-mp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatarangers-sdk-mp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2Fdatarangers-sdk-mp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/volcengine","download_url":"https://codeload.github.com/volcengine/datarangers-sdk-mp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868768,"owners_count":21174758,"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-10T12:22:06.297Z","updated_at":"2025-04-14T11:07:46.666Z","avatar_url":"https://github.com/volcengine.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"English | [简体中文](./README.zh-CN.md)\n\n# `DataRangers SDK - mp`\n\n## Build SDK\n\n```javascript\nnpm install\nnpm run build\n```\n\n## Sample\n\n### 1. Initialize the SDK in app.js\n\n```javascript\n// locally built references\n// const $$SDK = require('dist/tob/mp');\n\n// online package references\nconst $$SDK = require('@datarangers/sdk-mp');\n\n$$SDK.init({\n  app_id: 0000, // Replace it with the \"APP_ID\"\n  auto_report: true,\n  log: true, // Whether to print the log\n});\n\n$$SDK.config({\n  xxx: 'abc',\n});\n\n$$SDK.send(); // Setup complete and now events can be sent.\n\nApp({\n  onLaunch: function () {\n    this.$$SDK = $$SDK; // Bind to the global app function to be called by other pages.\n\n    //……\n  },\n});\n```\n\n### 2. Report custom user behavior events\n\n```javascript\n// Take reporting the \"video clicked\" behavior of users for example\napp.$$SDK.event('play_video', {\n  title: 'Here is the video title',\n});\n```\n\n### 3. Report the unique identifier of the currently logged in user\n\n```javascript\n// Set \"user_unique_id\" after a user logs in and the user's unique identifier is retrieved.\nsetTimeout(() =\u003e {\n  app.$$SDK.config({\n    user_unique_id: 'zhangsan', //Unique user identifier, can be \"open_id\".\n  });\n}, 1000);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Fdatarangers-sdk-mp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolcengine%2Fdatarangers-sdk-mp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Fdatarangers-sdk-mp/lists"}