Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-cloudinary-unsigned

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-cloudinary-unsigned

This module helps you to send files to [Cloudinary](https://cloudinary.com) through an [upload profile](https://cloudinary.com/console/settings/upload).

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by1000%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-cloudinary-unsigned

This module helps you to send files to Cloudinary through an upload profile.

Getting started

$ npm install react-native-cloudinary-unsigned --save

Mostly automatic installation

$ react-native link react-native-cloudinary-unsigned

Manual installation

iOS
  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-cloudinary-unsigned and add RNCloudinaryUnsigned.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNCloudinaryUnsigned.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<
Android
  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNCloudinaryUnsignedPackage; to the imports at the top of the file
  • Add new RNCloudinaryUnsignedPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-cloudinary-unsigned'
    project(':react-native-cloudinary-unsigned').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-cloudinary-unsigned/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-cloudinary-unsigned')
    

Usage

// Import library into your project
import RNCloudinaryUnsigned from "react-native-cloudinary-unsigned";

// Declare your credentials
const CLOUDINARY_CLOUD_NAME = "xxxxxx";
const CLOUDINARY_UPLOAD_PROFILE_NAME = "xxxxxx";
RNCloudinaryUnsigned.init(CLOUDINARY_CLOUD_NAME, CLOUDINARY_UPLOAD_PROFILE_NAME)
  .then(res => console.log(res))
  .catch(err => console.error(err));

// Call function to upload or remove image
export default class App extends Component {
  // Upload an image
  uploadImage = file => {
    RNCloudinaryUnsigned.upload(file)
      .then(res => {
        console.log(res);
      })
      .catch(err => console.error(err));
  };
  // Delete an image
  deleteImage = token => {
    RNCloudinaryUnsigned.delete(token)
      .then(res => {
        console.log(res);
      })
      .catch(err => console.error(err));
  };
}

How safe / secure is it to use unsigned upload from mobile clients?

The only "risk" in using unsigned uploads with Cloudinary is the possibility that another person will view the source code of your uploader, replicate the configuration and issue uploads from another place onto your account.

However, the following is worth mentioning:

  • This will "only" allow them to initiate unsigned-uploads to your account (may result with a certain Storage/Transformations quotas abuse).
  • This will NOT allow anyone to Delete / Edit / Overwrite any of your existing content on the account. A list of supported unsigned-upload options is available here.
  • As a safety measure, from time to time, you may want to change your upload-preset's name (can be done via the account settings) to reduce the possibility of someone using your configuration without your permission.
  • Finally we must say that until the writing of these lines we haven't heard of anyone of our customers experiencing this kind of offense.

Keywords

FAQs

Package last updated on 14 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc