This sample project covers:
- Configuring a React Native application with the ImageKit JavaScript SDK
- Rendering images
- Setting authentication context for the SDK
- Applying common image manipulations
- Adding overlays to images
- Client-side file uploading
- Rendering videos
This project was bootstrapped with React Native CLI Quickstart. Head over to the link, choose your development OS and target OS and install its dependencies if not already done.
npm install
In app/config/Imagekit.js
, set the following parameters for authentication:
const urlEndpoint = "<YOUR_IMAGEKIT_URL_ENDPOINT>";
const publicKey = "<YOUR_IMAGEKIT_PUBLIC_KEY>";
const authenticationEndpoint = "http://localhost:8080/auth";
Required parameters are urlEndpoint
and publicKey
. The authenticationEndpoint
parameter is optional and only needed if you want to use the SDK for client-side file upload.
You can get the value of URL-endpoint from your ImageKit dashboard. API public key can be obtained from the developer section in your ImageKit dashboard.
npx react-native start
npx react-native run-ios
npx react-native run-android
Move to the server directory
cd server
Insert your private key in server/index.js
const privateKey = `private_XXXXXXXXXXXX`
API private key can be obtained from the developer section in your ImageKit dashboard.
Please note that file upload will only work if, along with the above, you have also defined publicKey
, urlEndpoint
, and authenticationEndpoint
variables in app/config/Imagekit.js
.
Install packages:
npm install
npm start
Node server will run at http://localhost:8080
.
- React Native quickstart guide - https://docs.imagekit.io/getting-started/quickstart-guides/react-native
- Javascript SDK and documentation - https://github.com/imagekit-developer/imagekit-javascript
If something doesn't work as expected, report a bug at support@imagekit.io.