0.9.6 • Published 4 years ago

ionburst-sdk v0.9.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Ionburst SDK for JavaScript Gitter

The Ionburst SDK for JavaScript enables JavaScript developers to easily work with Ionburst and build ultra-secure and private storage into their applications.

Getting Help

Please use the following community resources to get help. We use Gitlab issues to track bugs and feature requests.

  • Join the Ionburst JavaScript chat on gitter
  • Get in touch with Ionburst Support
  • If it turns out that you may have found a bug, please open an issue

How to use

  • Install
npm install ionburst-sdk
  • Configuration Ionburst sdk gets it's configurations(ionburst_id, ionburst_key, ionburst_uri) from these 3 files. If ionburst_id and ionburst_key are not specified in .env file, it'll get them from credentials file with information from config.json If ionburst_uri is not specified in Ionburst constructor, it'll first check config.json, and then credentials file.
  • .env file
IONBURST_ID=******************                                      // UserName of Ionburst account 
IONBURST_KEY=********************************                       // Password of Ionburst account
  • config.json file in root directory
{
  "Ionburst": {
    "Profile": "test",                                                // Profile name to search in credentials file, Required for credentials file
    "ProfilesLocation": "...",                                        // Not Required, the location of credetials file which has profile information
    "IonBurstUri": "https://api.example.ionburst.io/",                // Server URI
    "TraceCredentialsFile": "OFF",                                    // If "ON", it shows log for processing credential file
  }
}
  • /.ionburst/credentials.ini in home directory
[test]                                                                // Profile name
ionburst_id=******************                                        // Username
ionburst_key=********************************                         // Password
ionburst_uri=https://api.example.ionburst.io/                         // Not Required, Server URI
  • Initialize
const Ionburst = require('ionburst-sdk')
var ionburst = Ionburst();

or

const Ionburst = require('ionburst-sdk')
var ionburst = Ionburst("https://api.example.ionburst.io/");
  • Upload Data With Callback:
ionburst.put({
  id: '...',
  data: '...',
  classstr: '...' // Not Required
}, function(err, data) {
  ...
});

With async/await:

let data = await ionburst.putAsync({
  id: '...',
  data: '...',
  classstr: '...'  // Not Required
});
  • Download Data With Callback:
ionburst.get(id, function(err, data) {
  ...
});

With async/await:

let data = await ionburst.getAsync(id);
  • Delete Data With Callback:
ionburst.delete(id, function(err, data) {
  ...
});

With async/await:

let data = await ionburst.deleteAsync(id);
  • Upload Data Deferred With Callback:
ionburst.startDeferredAction({
  action: 'PUT',
  id: '...',
  data: '...',
  classstr: '...'  // Not Required
}, function(err, token) {
  ...
});

With async/await:

let token = await ionburst.startDeferredActionAsync({
  action: 'PUT',
  id: '...',
  data: '...',
  classstr: '...'  // Not Required
});
  • Download Data Deferred With Callback:
ionburst.startDeferredAction({
  action: 'GET',
  id: '...'
}, function(err, token) {
  ...
});

With async/await:

let token = await ionburst.startDeferredActionAsync({
  action: 'GET',
  id: '...'
});
  • Check Data Deferred With Callback:
ionburst.checkDeferred(token, function(err, token) {
  ...
});

With async/await:

let result = await ionburst.fetch(token);
  • Fetch Data Deferred With Callback:
ionburst.fetch(token, function(err, result) {
  ...
});

With async/await:

let result = await ionburst.fetchAsync(token);
  • Get Classifcations With Callback:
ionburst.getClassifications(function(err, data) {
  ...
});

With async/await:

let data = await ionburst.getClassificationsAsync();

Opening Issues

If you find a bug, or have an issue with the Ionburst SDK for JavaScript we would like to hear about it. Check the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of Ionburst SDK JavaScript and the OS you’re using. Please include a stack trace and reduced repro case when appropriate, too.

The Gitlab issues are intended for bug reports and feature requests. For help and questions with using the Ionburst SDK for JavaScript please make use of the resources listed in the Getting Help section. There are limited resources available for handling issues and by keeping the list of open issues clean we can respond in a timely manner.

SDK Change Log

The change log for the SDK can be found in the Github Releases page

Tests

Dependencies

0.9.6

4 years ago

0.9.4

4 years ago

0.9.5

4 years ago

0.9.3

4 years ago

0.9.0

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago