npm install eact-native-url-polyfill
import 'react-native-url-polyfill/auto'
app/lib/imagekit.js
file, this is where we will initialize our SDK and create helper functions that will be used in the app.app/config/imagekit.js
urlEndpoint
is the required parameter. You can get the value of URL-endpoint from your ImageKit dashboard - https://imagekit.io/dashboard#url-endpoints.publicKey
and authenticationEndpoint
parameters are optional and only needed if you want to use the SDK for client-side file upload. You can get these parameters from the developer section in your ImageKit dashboard - https://imagekit.io/dashboard#developers.app/screens/Fetch/index.js
to fetch an image.Text
, Image
, Button
components created using React native's components for consistency, you can use them, original or any other UI kit if you want.height
for h
and width
for w
parameter. It makes your code more readable. If the property does not match any of the available options, it is added as it is. See the full list of supported transformations in React SDK on Github.h
and w
parameter instead of height
and width
.
See the complete list of transformations supported in ImageKit here.pad_resize
crop strategy. In this strategy, the output image's dimension (height and width) is the same as requested, no cropping occurs, and the aspect ratio is preserved. This is accomplished by adding padding around the output image to get it to match the exact dimension as requested. You can read more about this here.server
folder inside the tutorial project and install its npm packages:sample.env
file to .env
..env
file.app/config/imagekit.js
and replace the** **authenticationEndpoint
with http://localhost:8080/auth
react-native v0.63.3
which is the latest version at the time of writing this article, as the previous versions have a known issue in uploading files. If you are using a previous version and can't upgrade, you'll have to implement a workaround.app/lib/imagekit.js
file.react-native-document-picker
but you can use any picker.app/screens/Upload/index.js