Skip to main content
Pinata Expo Hooks are still under developement and will only work in iOS and Android at the moment. Please reach out if you have any issues!

Installation

Install with your package manager of choice

Source Code

pinata-expo-hooks is MIT open sourced and can be accessed on GitHub with the link below

PinataCloud/pinata-expo

Usage

Import at the top of your desired page or component
Inside your page or component use the hook to extract methods and state
Return types for useUpload
To upload a file you must already have a server setup that returns a Presigned URL. Then you can pass it into the upload method like so.
Below are the available UploadOptions that can be passed into upload
Once a file is uploaded the uploadResponse will contain the CID for the file. Below is a full example of implementing the useUpload hook with progress and abilities to pause and resume the upload.

Questions

Please contact us if you have any issues!