CloudRail SI for node.js
Integrate Multiple Services With Just One API
CloudRail is an API integration solution which abstracts multiple APIs from different providers into a single and universal interface.
--- ---
Learn more about CloudRail at https://cloudrail.com
Full documentation can be found here
With CloudRail, you can easily integrate external APIs into your application. CloudRail provides abstracted interfaces that take several services and then exposes a developer-friendly API that uses common functions between all providers. This means that, for example, upload() works in exactly the same way for Dropbox as it does for Google Drive, OneDrive, and other Cloud Storage Services, and getEmail() works similarly the same way across all social networks.
NPM
npm install cloudrail-si
Current Interfaces
Interface | Included Services |
---|---|
Cloud Storage | Dropbox, Google Drive, OneDrive, OneDrive Business, Box, Egnyte |
Business Cloud Storage | Amazon S3, Microsoft Azure, Google Cloud Services, Rackspace, Backblaze |
Social Profile | Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Instagram, Heroku |
Social Interaction | Facebook, Facebook Page, Twitter |
Payment | PayPal, Stripe |
Maljet, Sendgrid | |
SMS | Twilio, Nexmo |
Point of Interest | Google Places, Foursquare, Yelp |
Video | YouTube, Twitch, Vimeo |
Messaging | Facebook Messenger, Telegram, Line, Viber |
Cloud Storage Interface:
- Dropbox
- Box
- Google Drive
- Microsoft OneDrive
- Microsoft OneDrive for Business
- Egnyte
Features:
- Download files from Cloud Storage.
- Upload files to Cloud Storage.
- Get Meta Data of files, folders and perform all standard operations (copy, move, etc) with them.
- Retrieve user and quota information
- Generate share links for files and folders
- Get thumbnails for images
Code Example:
const cloudrail = ;cloudrailSettings; // let cs = new cloudrail.services.Box(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// let cs = new cloudrail.services.OneDrive(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// let cs = new cloudrail.services.OneDriveBusiness(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// let cs = new cloudrail.services.GoogleDrive(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");let cs = redirectReceiver "[clientIdentifier]" "[clientSecret]" "[redirectUri]" "[state]"; cs;
Business/Bucket Cloud Storage Interface:
- Amazon Web Services S3
- Microsoft Azure
- Google Cloud Services
- Rackspace
- Backblaze
Features
- Create, delete and list buckets
- Upload files
- Download files
- List files in a bucket and delete files
- Get file metadata (last modified, size, etc.)
Code Example
const cloudrail = ;cloudrailSettings; // let bcs = new cloudrail.services.AmazonS3(null, "[accessKeyId]", "[secretAccessKey]", "[region]");// let bcs = new cloudrail.services.MicrosoftAzure(null, "[accountName]", "[accessKey]");// let bcs = new cloudrail.services.GoogleCloudServices(null, "[clientEmail]", "[privateKey]", "[projectId]");// let bcs = new cloudrail.services.Rackspace(null, "[userName]", "[apiKey]", "[region]");let bcs = null "[accountId]" "[appKey]"; bcs;
Social Profile Interface:
- Github
- Google Plus
- Slack
- Windows Live
- Yahoo
- Heroku
Features
- Get profile information, including full names, emails, genders, date of birth, and locales.
- Retrieve profile pictures.
- Login using the Social Network.
Code Example:
const cloudrail = ;cloudrailSettings; // let profile = new cloudrail.services.GooglePlus(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// let profile = new cloudrail.services.GitHub(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// let profile = new cloudrail.services.Slack(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// let profile = new cloudrail.services.Instagram(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// ...let profile = redirectReceiver "[clientIdentifier]" "[clientSecret]" "[redirectUri]" "[state]"; profile; profile;
Social Interaction Interface:
- Facebook (interacts with a user)
- Facebook Pages (interacts with a page)
Features
- Get the IDs of a user's friends/followers. Works well with the Profile interface's "login with" to check if two of your users are friends on a platform
- Post messages to a wall/stream
- Post pictures and videos to a wall/stream
Code Example:
const cloudrail = ;cloudrailSettings; // let social = new cloudrail.services.Facebook(redirectReceiver, "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");// let social = new cloudrail.services.FacebookPage(redirectReceiver, "[pageName]", "[clientIdentifier]", "[clientSecret]", "[redirectUri]", "[state]");let social = redirectReceiver "[clientIdentifier]" "[clientSecret]" "[redirectUri]"; social; let fileStream = fs;let size = fssize;social;
Payment Interface:
- PayPal
- Stripe
Features
- Perform charges
- Refund previously made charges
- Manage subscriptions
Code Example
const cloudrail = ;cloudrailSettings; // let payment = new cloudrail.services.Stripe(null, "[secretKey]");let payment = null true "[clientIdentifier]" "[clientSecret]"; let source = null 6 2021 "xxxxxxxxxxxxxxxx" "visa" "<FirstName>" "<LastName>" null;payment;
Email Interface:
- Mailjet
- Sendgrid
Features
- Send Email
Code Example
const cloudrail = ;cloudrailSettings; // let email = new cloudrail.services.Mailjet(null, "[clientID]", "[clientSecret]");let email = null "[APIKey]"; email;
SMS Interface:
- Twilio
- Nexmo
Features
- Send SMS
Code Example
const cloudrail = ;cloudrailSettings; // let sms = new cloudrail.services.Nexmo(null, "[clientIdentifier]", "[clientSecret]");let sms = null "[clientIdentifier]" "[clientSecret]"; sms;
Points of Interest Interface:
- Google Places
- Foursquare
- Yelp
Features
- Get a list of POIs nearby
- Filter by categories or search term
Code Example
const cloudrail = ;cloudrailSettings;// let poi = new cloudrail.services.Foursquare(null, "[clientID]", "[clientSecret]");// let poi = new cloudrail.services.Yelp(null, "[consumerKey]", "[consumerSecret]", "[token]", "[tokenSecret]");let poi = null "[apiKey]";poi;
Video Interface:
- YouTube
- Twitch
- Vimeo
Features
- Get channel metadata
- List videos for a channel
- Get video metadata
- Search for videos
- Upload a video
Code Example
const cloudrail = ;cloudrailSettings;// let video = new cloudrail.services.Twitch(redirectReceiver, "[clientID]", "[clientSecret]");// let video = new cloudrail.services.Vimeo(redirectReceiver, "[clientID]", "[clientSecret]");let video = redirectReceiver "[clientID]" "" "com.cloudrail.example:/auth" "state";video;
Messaging Interface:
- Facebook Messenger
- Telegram
- Line
- Viber
Features
- Send text messages
- Send files, images, videos and audios
- Parse a message received on your webhook
- Download the content of an attachment sent to your webhook
Code Example
const cloudrail = ;cloudrailSettings;// let messaging = new cloudrail.services.Line(null, "[BotToken]");// let messaging = new cloudrail.services.Telegram(null, "[BotToken]", "[WebhookUrl]");// let messaging = new cloudrail.services.Viber(null, "[BotToken]", "[WebhookUrl]", "[BotName]");let messaging = null "[BotToken]";messaging;
More interfaces are coming soon.
Advantages of Using CloudRail
-
Consistent Interfaces: As functions work the same across all services, you can perform tasks between services simply.
-
Easy Authentication: CloudRail includes easy ways to authenticate, to remove one of the biggest hassles of coding for external APIs.
-
Switch services instantly: One line of code is needed to set up the service you are using. Changing which service is as simple as changing the name to the one you wish to use.
-
Simple Documentation: There is no searching around Stack Overflow for the answer. The CloudRail Wiki is regularly updated, clean, and simple to use.
-
No Maintenance Times: The CloudRail Libraries are updated when a provider changes their API.
-
Direct Data: Everything happens directly in the Library. No data ever passes a CloudRail server.
NPM
npm install cloudrail-si
Typescript
(this only concerns Typescript users)
The package includes an index.d.ts file. To use the typings provided, include services and types like so:
/// <reference path="node_modules/cloudrail-si/index.d.ts" /> ;;; let poi:PointsOfInterest = null "[clientID]" "[clientSecret]"; poi;
Examples
Check out https://github.com/CloudRail/cloudrail-si-node-sdk/tree/master/examples for examples of how to e.g. implement a redirectReceiver and more complex use cases.
License Key
CloudRail provides a developer portal which offers usage insights for the SDKs and allows you to generate license keys.
It's free to sign up and generate a key.
Head over to https://developers.cloudrail.com
Pricing
Learn more about our pricing on https://cloudrail.com/cloudrail-pricing/
Other Platforms
CloudRail is also available for other platforms like Android, iOS and Java. You can find all libraries on https://cloudrail.com
Questions?
Get in touch at any time by emailing us: support@cloudrail.com
or
Tag a question with cloudrail on StackOverflow