Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clara

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clara

Clara.io API wrapper

  • 0.4.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
3
Weekly downloads
 
Created
Source

Clara.io api bindings for node.js

Installation

npm install clara

Quick start

$ npm install clara
$ clara set apiToken <api-token>
$ clara set username <username>
$ clara scenes:get <uuid>

API Overview

Create a clara instance with your api token and username:

// Visit https://clara.io/settings/api for your api token
var clara = require('clara')({apiToken: 'your-api-token', username: 'your-username'});

Every resource method returns a promise, or accepts an optional callback.

clara.scenes.list().then(function(scenes) {
}).catch(function(err) {
});

With callbacks:

clara.scenes.list({}, function(err, scenes) {
});

The parameters for each resource method are:

  • queryOptions: {Object} Any query parameters required for the call.
  • params: {Object|String} (Optional) The data for the method. If this is a string, the library will expect a filename to a json file that will be parsed and sent.
  • callback: {Function}
clara.scenes.update({sceneId: 'scene-id'}, './scene.json', function(err, result) {});
clara.scenes.create({}, function(err, newScene) {});

Command line overview

All commands are available from the command line runner as well.

$ clara --help
$ clara scenes:get --help
$ clara --apiToken <apiToken> --username <username> scenes:get <sceneId>

Available resources and methods

  • scenes:library [options] List public scenes
  • scenes:list [options] List your scenes
  • scenes:create [options] Create a new scene
  • scenes:update [options] Update a scene
  • scenes:get Get scene data
  • scenes:delete Delete a scene
  • scenes:clone Clone a scene
  • scenes:import [options] Import a file into the scene
  • scenes:export Export a scene
  • scenes:render [options] Render an image
  • scenes:command [options] Run a command
  • jobs:list [options] List your jobs
  • jobs:get Get job data
  • user:get Get User Profile
  • user:update [options] Update user profile
  • webhooks:list [options] List webhooks
  • webhooks:create [options] Create a webhook
  • webhooks:update [options] Update a webhook
  • set Set a configuration value to $HOME/.clara.json
  • get Return the current configuration for

Configuration

There are several ways to set up the configuration data, from highest to lowest priority:

  1. Pass directly (through function call, or command line).
clara --apiToken <apiToken> --username <username> scenes:get <sceneId>

Or with api:

var clara = require('clara')({apiToken: '...', username: '...'});
  1. Environment variables.

Any parameter can be passed through an environment variable, prefixed with clara_:

clara_apiToken=api-token-here clara_username=username clara scenes:get <uuid>
  1. Configuration file in current working directory

A json file named .clara.json can hold configuration data:

{
  "apiToken": "api-token-here",
  "username": "your-username"
}
  1. Configuration file in $HOME

If the configuration file .clara.json exists in $HOME, it will be used.

clara set, clara get

You can use the clara command line to quickly set/get your configuration data. It will write to $HOME/.clara.json:

$ clara set apiToken your-api-token
$ clara set username your-username
$ clara scenes:get scene-uuid

Development

Run the tests using npm:

$ npm install
$ npm tests

Keywords

FAQs

Package last updated on 15 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc