Magento BI Libraries

To make integrating with the Import API as easy as possible, we’ve created some client libraries for you to use. Have your own library? Want to contribute to ours? Reach out to us!


Clojure

Installation

You can install the RJMetrics Clojure client library by adding the following dependency to your project.clj.

[rjmetrics "0.2.0"]

Now, you can use the library like this:

(ns example
  (:require [rjmetrics.core :as rjmetrics]))

(def config-map {:client-id 1
                  :api-key "your-api-key"})

(when (rjmetrics/authenticated? config-map)
  ;; do stuff with client
  )

For more information, check out the source code on Github.


Javascript

Installation

The RJMetrics Javascript client library is available via npm:

npm install rjmetrics

You can also install it via npm by adding the following line to the dependencies field in your package.json file:

"rjmetrics": "0.2.0"

Now, you can use the library like this:

var rjmetrics = require("rjmetrics");
client = rjmetrics.Client(client_id, api_key);

# do stuff with client

For more information, check out the source code on Github.


PHP

Installation

The RJMetrics PHP client library can be installed using Composer.

Add the following to your project’s composer.json:

{
  "require": {
    ...
    "rjmetrics/rjmetrics-client": "0.2.0"
  }
}

Now, you can use the library in your script, like this:

<?php

require 'vendor/autoload.php';
$client = new RJMetrics\Client($myClientId, $myApiKey);

/* do stuff with $client */

?>

For more information, you can see the documentation for Httpful or view the source on Github.


Python

Installation

You can install the RJMetrics Python client library with pip or easy_install.

pip install rjmetrics

You can also install it by adding the following line to a pip requirements file:

rjmetrics

Now, you can use the library like this:

from rjmetrics.client import Client
client = Client(client_id, api_key)

# do stuff with client

For more information, check out the source code on Github.


Ruby

Installation

The RJMetrics Ruby client library is available as a gem:

gem install rjmetrics-client

You can also install it via bundler by adding the following line in your Gemfile:

gem 'rjmetrics-client'

Now, you can use the library like this:

require "rjmetrics_client"
client = RJMetricsClient.new(client_id, api_key)

# do stuff with client

For more information, check out the source code on Github.