Ideea Public API JavaScript SDK
Branch: master
Clone or download
Latest commit 158ccfb Feb 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src v1 Jan 21, 2019
test
.babelrc v1 Jan 21, 2019
.editorconfig v1 Jan 21, 2019
.eslintignore
.eslintrc v1 Jan 21, 2019
.gitignore v1 Jan 21, 2019
.npmignore
.travis.yml v1 Jan 21, 2019
LICENSE
README.md intro Feb 22, 2019
package.json Readme Feb 21, 2019

README.md

Ideea


Ideea.io     Getting Started     Cheat Sheet     Full Documentation


Ideea JS SDK

This is the official SDK for the Ideea platform. You can use this SDK to manage users and groups, create API Keys and get billing information.

Installation

$ npm install ideea-js

Getting Started

const Scape = require('scape-js')
const fs = require('fs')


var scape = new Scape('6B1AEBDF03B69CC1FB59BD33162410979213A8FF4CF59CAE54E3436D5535E318')

var image = fs.readFileSync('./image.png')

scape.upload(image, {
	bucket_id: '00ce6d6a-ea29-4840-9b5d-cd1f6ae3bc6b'
}).then(function (image) {
	console.log(image)
})

Methods

This is not a complete list of methods. Please refer to the full documentation for the full list of methods.

.login(email, password)

This route is used to generate a new access token.

scape.login('johndoe@gmail.com', 'password').then((accessToken) => {
	console.log(accessToken)
})

.getUser()

To get the current user use the method .getUser()

scape.getUser().then((user) => {
	console.log(user.email);
	console.log(user.first_name);
	console.log(user.last_name);
})

.getGroup(groupID)

To a group by ID

scape.getGroup('00ce6d6a-ea29-4840-9b5d-cd1f6ae3bc6b').then((group) => {
	console.log(group.id);
	console.log(group.name);
})

.getGroupUsers(groupID)

Get the users in a specific group

scape.getGroupUsers('00ce6d6a-ea29-4840-9b5d-cd1f6ae3bc6b').then((users) => {
	users.map(user => {
		console.log(user)
	})
})

.getApiKeys(groupID)

Get all of the API keys associted with a specific group

scape.getApiKeys('00ce6d6a-ea29-4840-9b5d-cd1f6ae3bc6b').then((apiKeys) => {
	apiKeys.map(apikey => {
		console.log(apikey)
	})
})