{"id":20147461,"url":"https://github.com/dittofeed/sdk-react-native","last_synced_at":"2025-04-09T19:40:26.875Z","repository":{"id":181065996,"uuid":"659897927","full_name":"dittofeed/sdk-react-native","owner":"dittofeed","description":"Dittofeed's react native sdk.","archived":false,"fork":false,"pushed_at":"2024-08-13T03:35:15.000Z","size":4024,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T21:35:44.870Z","etag":null,"topics":["customer-engagement","react-native"],"latest_commit_sha":null,"homepage":"https://www.dittofeed.com/","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/dittofeed.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":"2023-06-28T20:03:21.000Z","updated_at":"2024-08-13T03:35:18.000Z","dependencies_parsed_at":"2024-08-13T04:41:22.429Z","dependency_job_id":"4a9dde0c-dbc0-4c6c-95b8-8015f39401ce","html_url":"https://github.com/dittofeed/sdk-react-native","commit_stats":null,"previous_names":["dittofeed/sdk-react-native"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dittofeed%2Fsdk-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dittofeed%2Fsdk-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dittofeed%2Fsdk-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dittofeed%2Fsdk-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dittofeed","download_url":"https://codeload.github.com/dittofeed/sdk-react-native/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248100163,"owners_count":21047751,"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":["customer-engagement","react-native"],"created_at":"2024-11-13T22:29:09.219Z","updated_at":"2025-04-09T19:40:26.856Z","avatar_url":"https://github.com/dittofeed.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sdk-react-native\n\nDittofeed's react native sdk.\n\n## Installation\n\n```bash\n# Using Yarn\nyarn add @dittofeed/sdk-react-native\n\n# Using NPM\nnpm install --save @dittofeed/sdk-react-native\n```\n\n## Usage\n\nDittofeed's react native sdk can be useful for sending Dittofeed events about your application and users.\n\n```javascript\nimport React from \"react\";\nimport { StyleSheet, Text, View } from \"react-native\";\nimport { DittofeedSdk } from \"@dittofeed/sdk-react-native\";\nimport { useEffect } from \"react\";\n\nexport default function App() {\n  useEffect(() =\u003e {\n    (async () =\u003e {\n      // Initialize the sdk with a writeKey, which is used to identify your\n      // workspace. This key can be found at\n      // https://dittofeed.com/dashboard/settings\n      await DittofeedSdk.init({\n        writeKey: \"Basic abcdefg...\",\n      });\n\n      // Lets you tie a user to their actions and record traits about them. It\n      // includes a unique User ID and any optional traits you know about the\n      // user, like their email, name, and more.\n      DittofeedSdk.identify({\n        userId: \"123\",\n        traits: {\n          email: \"john@email.com\",\n          firstName: \"John\"\n        },\n      });\n\n      // The track call is how you record any actions your users perform, along\n      // with any properties that describe the action.\n      DittofeedSdk.track({\n        userId: \"123\",\n        event: \"Made Purchase\",\n        properties: {\n          itemId: \"abc\",\n        },\n      });\n\n      // Lets you record whenever a user sees a screen, the mobile equivalent of\n      // page, in your mobile app, along with any properties about the screen.\n      DittofeedSdk.screen({\n        userId: \"123\",\n        name: \"Recipe Screen\",\n        properties: {\n          recipeType: \"Soup\",\n        },\n      });\n\n      // Ensures that asynchronously submitted events are flushed synchronously\n      // to Dittofeed's API.\n      await DittofeedSdk.flush();\n    })();\n  }, []);\n\n  return (\n    \u003cView style={styles.container}\u003e\n      \u003cText\u003eMy App\u003c/Text\u003e\n    \u003c/View\u003e\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: \"#fff\",\n    alignItems: \"center\",\n    justifyContent: \"center\",\n  },\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdittofeed%2Fsdk-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdittofeed%2Fsdk-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdittofeed%2Fsdk-react-native/lists"}