Giter Club home page Giter Club logo

ionburst-sdk-javascript's Introduction

npm Snyk Vulnerabilities for npm package Gitlab pipeline status slack

Ionburst SDK for JavaScript

The Ionburst SDK for Javascript enables developers to easily integrate with Ionburst Cloud, building in ultra-secure and private object storage to their applications.

Getting Started

Installation

npm i ionburst-sdk-javascript

Configuration

The Ionburst SDK can get its configuration (ionburst_id, ionburst_key, ionburst_uri) from the following three files.

If ionburst_id and ionburst_key are not specified by environment variable, they are obtained from the credentials file with information from the config.json file.

If ionburst_uri is not specified in Ionburst constructor, it'll first check config.json, and then the credentials file.

Environment Variables

IONBURST_ID=IB******************
IONBURST_KEY=eW91aGF2ZXRvb211Y2h0aW1lb255b3VyaGFuZHMh

config.json file

{
  "Ionburst": {
    "Profile": "test",
    "IonburstUri": "https://api.example.ionburst.cloud/",
    "TraceCredentialsFile": "OFF"
  }
}

Credentials file

[example]
ionburst_id=IB******************
ionburst_key=eW91aGF2ZXRvb211Y2h0aW1lb255b3VyaGFuZHMh
ionburst_uri=https://api.example.ionburst.cloud/

Usage

Initialise

const Ionburst = require('ionburst-sdk')
var ionburst = Ionburst();

or

const Ionburst = require('ionburst-sdk')
var ionburst = Ionburst("https://api.example.ionburst.cloud/");

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.checkDeferredAsync(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();

Getting Help

Please use the following community resources for support. We use GitLab issues to track bugs and feature requests.

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 steps to reproduce the issue.

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 Changelog

The changelog for the SDK can be found in the CHANGELOG file.

Contributors

A massive thanks to Costin Botez for developing this SDK.

Dependencies

ionburst-sdk-javascript's People

Contributors

costibotez avatar jishf avatar

Stargazers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.