{"_id":"rn-form-io-lib","_rev":"29-02ebd818f4ea7f8ea357f56d874f7e3e","name":"rn-form-io-lib","dist-tags":{"latest":"1.0.34"},"versions":{"1.0.33":{"name":"rn-form-io-lib","version":"1.0.33","_id":"rn-form-io-lib@1.0.33","maintainers":[{"name":"prash_k997","email":"prashanth.k0620@gmail.com"}],"dist":{"shasum":"687d6f1e8f998ff3361f745cb0853e469e953522","tarball":"https://registry.npmjs.org/rn-form-io-lib/-/rn-form-io-lib-1.0.33.tgz","fileCount":20,"integrity":"sha512-qkrRVvyuG9zk8mEelqEpgHunvBXMZ8+GowxitzibVMAduoFr2HbzDutC98fklLvcUyORVpCSEOIIN+Mk7NuJQA==","signatures":[{"sig":"MEYCIQDb5XO6o7e6G4ZhGDkmvEK5kiE5ldAgHCX1H2qoLDXwHQIhAP2lV//PgRjmGOy6wG+zkEmUJH8Nsh4ZoqOlo/kPQ13d","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13911263},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"efc7a8b1e72cc876df052f564ebba651129c3874","scripts":{"build":"npm run build:html && npm run build:native","build:html":"node scripts/build.js","postinstall":"node scripts/link-assets.js","build:native":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"_npmUser":{"name":"prash_k997","email":"prashanth.k0620@gmail.com"},"_npmVersion":"10.9.2","description":"Cross-platform HTML form bundled for React Native, Web, and Android","directories":{},"_nodeVersion":"22.16.0","dependencies":{"react-native-webview":"^13.13.5","@unvired/turboforms-embed-sdk":"^1.0.14","react-native-safe-area-context":"^5.6.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.0.4","@types/react":"^19.0.0","@types/react-native":"^0.72.8"},"peerDependencies":{"react":">=17.0.0","react-native":">=0.68.0","react-native-webview":"^13.13.5"},"_npmOperationalInternal":{"tmp":"tmp/rn-form-io-lib_1.0.33_1774877853079_0.9463509933148022","host":"s3://npm-registry-packages-npm-production"}},"1.0.34":{"name":"rn-form-io-lib","version":"1.0.34","description":"Cross-platform HTML form bundled for React Native, Web, and Android","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build:html":"node scripts/build.js","build:native":"tsc -p tsconfig.json","build":"npm run build:html && npm run build:native","postinstall":"node scripts/link-assets.js","prepublishOnly":"npm run build"},"devDependencies":{"@types/react":"^19.0.0","@types/react-native":"^0.72.8","typescript":"5.0.4"},"publishConfig":{"access":"public"},"dependencies":{"@unvired/turboforms-embed-sdk":"^1.0.14","react-native-safe-area-context":"^5.6.1","react-native-webview":"^13.13.5"},"peerDependencies":{"react":">=17.0.0","react-native":">=0.68.0","react-native-webview":"^13.13.5"},"_id":"rn-form-io-lib@1.0.34","gitHead":"efc7a8b1e72cc876df052f564ebba651129c3874","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Sh63LEaVW0bmUayIGmoEDe9DZqae7cpMS3ISrahtHa8ZFhmuqhcxUZbZ6OvGaAIgfa0MzmyOBw1DFSIXdEBpbQ==","shasum":"6923e0a71ec2eeba38f910188370828a23cce5b7","tarball":"https://registry.npmjs.org/rn-form-io-lib/-/rn-form-io-lib-1.0.34.tgz","fileCount":20,"unpackedSize":13911263,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBX2qckoIL2KXRkgHIT/6OsDW48t7vAC7BJHJo0eL0ENAiA46b1FRXVKa+hYxja0SHwsx4++V9sqI9vgRpFzz9y4Lw=="}]},"_npmUser":{"name":"prash_k997","email":"prashanth.k0620@gmail.com"},"directories":{},"maintainers":[{"name":"prash_k997","email":"prashanth.k0620@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rn-form-io-lib_1.0.34_1774877876422_0.05863792821942537"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-30T13:37:33.000Z","modified":"2026-03-30T13:37:57.072Z","1.0.0":"2025-05-02T06:58:29.577Z","1.0.1":"2025-05-02T07:44:41.708Z","1.0.2":"2025-05-08T07:20:58.975Z","1.0.3":"2025-05-08T07:29:25.771Z","1.0.4":"2025-05-08T09:47:19.942Z","1.0.5":"2025-05-12T07:41:37.724Z","1.0.6":"2025-05-12T07:51:04.122Z","1.0.7":"2025-05-12T10:54:51.671Z","1.0.8":"2025-05-12T11:27:34.650Z","1.0.9":"2025-05-13T12:43:14.601Z","1.0.11":"2025-07-23T07:49:33.066Z","1.0.12":"2025-07-24T12:12:16.933Z","1.0.13":"2025-08-06T11:55:15.164Z","1.0.14":"2025-08-06T13:14:43.325Z","1.0.15":"2025-08-06T13:17:52.323Z","1.0.16":"2025-08-06T13:22:52.609Z","1.0.17":"2025-08-06T13:33:17.221Z","1.0.18":"2025-08-07T04:50:42.115Z","1.0.19":"2025-08-29T12:00:52.436Z","1.0.22":"2025-09-05T10:57:07.497Z","1.0.25":"2025-10-16T13:25:06.445Z","1.0.26":"2025-12-01T11:06:50.705Z","1.0.27":"2025-12-01T11:20:24.354Z","1.0.28":"2025-12-01T11:21:57.158Z","1.0.29":"2025-12-01T11:24:48.337Z","1.0.31":"2025-12-01T11:29:05.088Z","1.0.33":"2026-03-30T13:37:33.484Z","1.0.34":"2026-03-30T13:37:56.733Z"},"description":"Cross-platform HTML form bundled for React Native, Web, and Android","maintainers":[{"name":"prash_k997","email":"prashanth.k0620@gmail.com"}],"readme":"# Unvired Forms React Native SDK\r\n\r\nA robust React Native wrapper for the Unvired Forms SDK, providing a seamless bridge between your mobile application and powerful dynamic forms.\r\n\r\n## Features\r\n\r\n- **Embedded WebView**: Renders complex forms using a high-performance WebView.\r\n- **Native Bridges**: Direct integration with device features like Camera, Barcode Scanning, and Location.\r\n- **Attachment Management**: Centralized utility for handling file attachments and IndexedDB persistence.\r\n- **Form Lifecycles**: Full support for form rendering, saving, submission, and validation events.\r\n- **Theming & Customization**: Pass theme data and configuration options directly from React Native.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install rn-form-io-lib\r\n```\r\n\r\n### Automation (Asset Linking)\r\nThis library includes a `postinstall` script that automatically copies the required HTML assets:\r\n- **Android**: Automatically copied to `android/app/src/main/assets/`.\r\n- **iOS**: Bundled automatically via the React Native asset system.\r\n\r\n### Peer Dependencies\r\nEnsure you have the following dependencies installed in your project:\r\n- `react-native-webview`\r\n- `react-native-safe-area-context`\r\n\r\n\r\n## Basic Usage\r\n\r\n```tsx\r\nimport React, { useRef } from 'react';\r\nimport { SDKFormWrapper, FORM_EVENTS } from './path/to/sdk';\r\n\r\nconst MyFormScreen = () => {\r\n  const webViewRef = useRef(null);\r\n\r\n  const handleEvent = (event) => {\r\n    switch (event.type) {\r\n      case FORM_EVENTS.SUBMIT:\r\n        console.log('Form Submitted:', event.data.formData);\r\n        break;\r\n      case \"GET_ATTACHMENT\":\r\n        // Handle missing attachments\r\n        break;\r\n    }\r\n  };\r\n\r\n  return (\r\n    <SDKFormWrapper\r\n      ref={webViewRef}\r\n      formsData={formTemplateJson}\r\n      submissionData={existingDataJson}\r\n      eventCallback={handleEvent}\r\n      options={{\r\n        platform: 'ios',\r\n        themeData: myTheme,\r\n      }}\r\n    />\r\n  );\r\n};\r\n```\r\n\r\n## Attachment Management\r\n\r\nWhen the SDK requests a missing attachment via the `GET_ATTACHMENT` event, use the `AttachmentManager` to resolve it:\r\n\r\n```tsx\r\nimport { AttachmentManager } from './path/to/sdk';\r\n\r\n// Inside your event handler\r\nif (event.type === \"GET_ATTACHMENT\") {\r\n  const attachments = event.data.missingFiles.map(file => ({\r\n    fileId: file.fileId,\r\n    name: \"resolved_file.png\",\r\n    size: 1024,\r\n    type: \"image/png\",\r\n    url: \"data:image/png;base64,...\"\r\n  }));\r\n\r\n  AttachmentManager.saveMultipleToIndexedDB(webViewRef, attachments);\r\n}\r\n\r\n// When resolution is complete, refresh the form\r\nif (event.type === \"ATTACHMENT_SAVED\") {\r\n  webViewRef.current.reloadForm();\r\n}\r\n```\r\n\r\n## API Reference\r\n\r\n### SDKFormWrapper Props\r\n\r\n| Prop | Type | Description |\r\n| :--- | :--- | :--- |\r\n| `formsData` | `string \\| object` | The form template JSON. |\r\n| `submissionData` | `object` | Initial data for the form fields. |\r\n| `eventCallback` | `function` | Handlers for SDK events. |\r\n| `options` | `object` | Configuration (theme, permissions, etc.). |\r\n\r\n### Exposed Methods via Ref\r\n\r\n- **`reloadForm()`**: Re-injects the current payload into the WebView, useful for refreshing after data updates or attachment resolution.\r\n\r\n---\r\n© 2026 Unvired Inc. All rights reserved.\r\n","readmeFilename":"README.md"}