{"id":15040962,"url":"https://github.com/xtravision-ai/xtravision-react-native","last_synced_at":"2025-04-14T19:36:01.672Z","repository":{"id":59142613,"uuid":"530672113","full_name":"xtravision-ai/xtravision-react-native","owner":"xtravision-ai","description":"React Native SDK for XtraVision","archived":false,"fork":false,"pushed_at":"2024-01-16T09:39:47.000Z","size":3359,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T08:01:39.294Z","etag":null,"topics":["android-app","ios-app","react-native"],"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/xtravision-ai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2022-08-30T13:34:35.000Z","updated_at":"2023-07-18T09:15:55.000Z","dependencies_parsed_at":"2023-12-17T16:42:34.128Z","dependency_job_id":null,"html_url":"https://github.com/xtravision-ai/xtravision-react-native","commit_stats":{"total_commits":102,"total_committers":8,"mean_commits":12.75,"dds":0.5392156862745099,"last_synced_commit":"c7e16fd26e6bcfe6dfbee79883536476c8a25cec"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtravision-ai%2Fxtravision-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtravision-ai%2Fxtravision-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtravision-ai%2Fxtravision-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtravision-ai%2Fxtravision-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtravision-ai","download_url":"https://codeload.github.com/xtravision-ai/xtravision-react-native/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248946809,"owners_count":21187580,"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":["android-app","ios-app","react-native"],"created_at":"2024-09-24T20:45:20.288Z","updated_at":"2025-04-14T19:36:01.627Z","avatar_url":"https://github.com/xtravision-ai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xtravision-react-native\n\"xtravision-react-native\" SDK allows you to quickly and easily use the [xtravision.ai](https://xtravision.ai/) APIs via React Native.\n\n\n## Installation (RN \u003e= 0.71)\nUse the following command to install SDK and its dependencies.\n```sh\nyarn add react-native-reanimated@^2.10.0 react-native-vision-camera@^2.15.4 @xtravision/xtravision-react-native@3.2.2\n```\n\u003e use SDK 2.9.x version for RN \u003c= 0.70 \n\n\nAdd the required plugin to your babel.config.js:\n```js\nmodule.exports = {\n    plugins: [\n        [\n            'react-native-reanimated/plugin',\n            {\n                globals: ['__scanPoseLandmarks'],\n            },\n        ],\n        // others\n    ]\n}\n```\n\u003e Note: You have to restart metro-bundler for changes in the babel.config.js file to take effect. Best practice to start metro server with `--reset-cache`\n\n\n## Usage\n\n```js\n// Import required things\nimport { RequestCameraPermission, Assessment} from '@xtravision/xtravision-react-native';\nimport {CameraPermissionStatus} from '@xtravision/xtravision-react-native';\n\nexport default function App() {\n  const [hasPermission, setHasPermission] = React.useState(false);\n\n  React.useEffect(() =\u003e {\n    (async () =\u003e {\n      const status = await RequestCameraPermission();\n      setHasPermission(status === CameraPermissionStatus.AUTHORIZED);\n    })();\n  }, []);\n\n  \n  // Callback to handle server response\n  function onServerResponse(serverResponse: any): void {\n    if (serverResponse.errors.length) {\n      console.error('Server Error Response:', serverResponse.errors);\n      return;\n    }\n\n    console.log('Server Data:', serverResponse.data);\n  }\n\n  // required prop:\n  const authToken = '__AUTH-TOKEN__'; //IMP: user specific auth token\n  const assessmentName = '__ASSESSMENT_NAME__';\n  const cameraPosition = 'back'; // front or back\n\n\n  const connectionData = {\n    assessment_name: assessmentName,\n    auth_token: authToken,\n    assessment_config: {},  // check document for more details\n    user_config:{}, // check document for more details\n  };\n\n  const requestData = {\n    isPreJoin: false\n  }\n  \n  const libData = {\n    onServerResponse,\n    cameraPosition,\n  }\n\n  return (\n    \u003cView style={styles.container}\u003e\n      {hasPermission ? (\n        \u003c\u003e\n          \u003cAssessment\n            connectionData={connectionData}\n            requestData={requestData}\n            libData={libData}\n          /\u003e\n        \u003c/\u003e\n      ) : (\n        \u003c\u003e\n          \u003cText\u003eApp don't have Camera Permission\u003c/Text\u003e\n        \u003c/\u003e\n      )}\n    \u003c/View\u003e\n  );\n}\n```\n\n\n\n\u003e Tested with Node:v16.14.0 and react-native: v0.71.0\n\u003e Make sure you have added `kotlinVersion = \"1.7.0\"` (under buildToolsVersion) to `android/build.gradle`\n\u003e Currently it's supporting only android devices only \n\n## License\nMIT\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtravision-ai%2Fxtravision-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtravision-ai%2Fxtravision-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtravision-ai%2Fxtravision-react-native/lists"}