Gathering detailed insights and metrics for react-native-activestorage
Gathering detailed insights and metrics for react-native-activestorage
Gathering detailed insights and metrics for react-native-activestorage
Gathering detailed insights and metrics for react-native-activestorage
npm install react-native-activestorage
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
15 Stars
34 Commits
12 Forks
1 Watchers
3 Branches
3 Contributors
Updated on Sep 14, 2024
Latest Version
2.0.0
Package Id
react-native-activestorage@2.0.0
Unpacked Size
62.18 kB
Size
13.67 kB
File Count
31
NPM Version
9.6.6
Node Version
20.2.0
Published on
Jun 12, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
Use direct upload for uploading files to Rails ActiveStorage.
Install this package and react-native-blob-util
1yarn add react-native-activestorage react-native-blob-util
1import { ActiveStorageProvider } from 'react-native-activestorage' 2 3const App = () => ( 4 <ActiveStorageProvider host="https://localhost:4000"> 5 <Navigation /> 6 </ActiveStorageProvider> 7)
You can provide mountPath
to provider if you have different than /rails/active_storage
1import { useDirectUpload } from 'react-native-activestorage' 2 3const Upload = () => { 4 const onSuccess = ({ signedIds }) => { 5 // Do something; 6 } 7 8 const { upload, uploading, uploads } = useDirectUpload({ onSuccess }); 9 10 const onUploadButtonClick = async () => { 11 const files = await showPicker(); 12 const { signedIds } = await upload(files); 13 // Assign signed IDs 14 } 15 16 return ( 17 <View> 18 <View onClick={onUploadButtonClick}> 19 <Text>Upload</Text> 20 </View> 21 22 {uploads.map(upload => ( 23 <UploadItem upload={upload} key={upload.id} /> 24 ))} 25 </View> 26 ) 27}
1import { DirectUpload } from 'react-native-activestorage' 2 3const Upload = () => ( 4 <DirectUpload onSuccess={({ signedIds }) => console.warn({ signedIds })}> 5 {({ upload, uploading, uploads }) => ( 6 <View> 7 <View onClick={() => showPicker((files) => upload(files))}> 8 <Text>Upload</Text> 9 </View> 10 {uploads.map(upload => <UploadItem upload={upload} key={upload.id} />)} 11 </View> 12 )} 13 </DirectUpload> 14)
directUpload
without React1import { directUpload } from 'react-native-activestorage' 2 3const file = { 4 name: 'image.jpg', 5 size: 123456, 6 type: 'image/jpeg', 7 path: '/var/lib/...' 8} 9 10const directUploadsUrl = 'https://localhost:3000/rails/active_storage/direct_uploads'; 11 12const onStatusChange = ({ status, progress, cancel }) => { 13 // status - waiting/uploading/success/error/canceled 14 // progress - 0-100% (for uploading status) 15 // cancel - function to stop uploading a file 16} 17 18directUpload({ file, directUploadsUrl, onStatusChange });
The package is available as open source under the terms of the MIT License.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/17 approved changesets -- score normalized to 1
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More