3.3.3 • Published 4 years ago

metal-cloud-sdk v3.3.3

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
4 years ago

Metal Cloud SDK

SDK for the Metal Cloud infrastructure

This library is tested in browsers (>= IE10) and in Node.js (>=7.8).

Branches

If you are an user, you should use the branch with the highest version number. The dev_master branch is used internally for development.

Install

npm install

If you want to run the SDK inside the browser, you must bundle the project using webpack by running:

npm run build

The generated bundle wil be placed in dist/ .

Usage

NodeJS

const MetalCloud = require("metal-cloud-sdk");
const JSONRPC = require("jsonrpc-bidirectional");

(async () => {
	
	const strEndpointURL = "https://fullmetal.bigstep.com/api/";
	const strAPIKey = "00:pl34s3c0pyth34p1k3yfr0mth3bs14dm1n1nt3rf4c3"; // the API key can be found in the interface myBigstep > Metal Cloud > API

	const api = new MetalCloud.Clients.API(strEndpointURL);
	api.addPlugin(new JSONRPC.Plugins.Client.SignatureAdd(strAPIKey));

	// The client is now initialized and authenticated. You can now execute functions through the Metal Cloud API.
    // Example:

	const strEmail = "example@mail.com" // change to your email
	const objUser = await api.user_get(strEmail);
    console.log(objUser);
})();

Browser

<!doctype html>
<html>
	<head>
		<title>Test</title>

		<!-- These are external to the generated bundle intentionally, to reduce file size and reuse them for other libraries. -->
		<script type="text/javascript" src="node_modules/babel-polyfill/dist/polyfill.min.js"></script>
		<script type="text/javascript" src="node_modules/whatwg-fetch/fetch.js"></script>
		<script type="text/javascript" src="node_modules/es6-promise/dist/es6-promise.auto.min.js"></script>

		<script type="text/javascript" src="builds/browser/es5/metal-cloud-sdk.min.js"></script>

		<script>
			var strEndpointURL = "https://fullmetal.bigstep.com/api/";
			var strAPIKey = "00:pl34s3c0pyth34p1k3yfr0mth3bs14dm1n1nt3rf4c3"; // the API key can be found in the interface myBigstep > Metal Cloud > API
			var strEmail = "example@mail.com"; // Change to your email.

			new MetalCloud.Clients.API(strEndpointURL)
				.then(function(client) {
					api = client; 
					api.addPlugin(new JSONRPC.Plugins.Client.SignatureAdd(strAPIKey));

					// The client is now initialized and authenticated. You can now execute functions through the MetalCloud API.
					// Example:
					api.user_get(strEmail)
						.then(function(response) {
                            var objUser = response;
                            console.log(objUser);
                        })
                    ;

					// You can find more examples in the "examples" folder.
				})
			;
		</script>
	</head>
	<body>
		Open the developer tools console (F12 for most browsers, CTRL+SHIFT+I in Electron) to see errors or manually make calls.
	</body>
</html>

You can find more usage examples in the examples folder.

3.3.3

4 years ago

3.3.2

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.1.0

5 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.14.1

6 years ago

2.14.0

6 years ago

2.13.2

6 years ago

2.13.1

6 years ago

2.13.0

6 years ago

2.12.2

6 years ago

2.4.1

6 years ago

2.12.1

7 years ago

2.10.3

7 years ago

2.10.1

7 years ago

2.10.0

7 years ago

2.11.5

7 years ago

2.11.4

7 years ago

2.11.3

7 years ago

2.11.2

7 years ago

2.11.1

7 years ago

2.11.0

7 years ago

2.5.6

7 years ago

2.5.4

7 years ago

2.5.2

7 years ago

2.5.1

7 years ago

2.5.0

7 years ago