Uploadify is SAAS that allows you to easily upload files to the cloud. This README will guide you through the process of setting up and using Uploadify.
-
Create an account on uploadify.itsgaurav.co to get your client key and secret.
-
Create a
.env
file in the root directory of your project and add your client key and secret in it:API_KEY=your_api_key_here SECRET=your_secret_here
-
Install the
younicorn_uploadify
package:npm install younicorn_uploadify yarn add younicorn_uploadify pnpm i younicorn_uploadify
-
Create an instance of the
uploadify
class:import uploadify from "younicorn_uploadify" const instance = new uploadify(API_KEY, SECRET)
-
Use the
upload
method to upload a file:const {response, error} = await instance.upload(file)
Creates a new instance of the uploadify
class.
API_KEY
- Your Uploadify API key.SECRET
- Your Uploadify API secret.
Uploads a file to the cloud.
file
- The file to upload.
Returns an object containing the uploaded file's data and any errors that occurred during the upload.
-
response
- The uploaded file's data.response={ url: string; fileName: string; }
-
error
- Any errors that occurred during the upload.
This project is licensed under the MIT License - see the LICENSE file for details.