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
You can install the RJMetrics Clojure client library by adding the following dependency to your project.clj
.
Copied to your clipboard[rjmetrics "0.2.0"]
Now, you can use the library like this:
Copied to your clipboard(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
The RJMetrics Javascript client library is available via npm:
Copied to your clipboardnpm install rjmetrics
You can also install it via npm by adding the following line to the dependencies field in your package.json
file:
Copied to your clipboard"rjmetrics": "0.2.0"
Now, you can use the library like this:
Copied to your clipboardvar 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
The RJMetrics PHP client library can be installed using Composer.
Add the following to your project's composer.json
:
Copied to your clipboard{"require": {..."rjmetrics/rjmetrics-client": "0.2.0"}}
Now, you can use the library in your script, like this:
Copied to your clipboard<?phprequire 'vendor/autoload.php';$client = new RJMetrics\Client($myClientId, $myApiKey);/* do stuff with $client */?>
For more information, you can view the source on Github.
Python
You can install the RJMetrics Python client library with pip
or easy_install
.
Copied to your clipboardpip install rjmetrics
You can also install it by adding the following line to a pip requirements file:
Copied to your clipboardrjmetrics
Now, you can use the library like this:
Copied to your clipboardfrom rjmetrics.client import Clientclient = Client(client_id, api_key)# do stuff with client
For more information, check out the source code on Github.
Ruby
The RJMetrics Ruby client library is available as a gem:
Copied to your clipboardgem install rjmetrics-client
You can also install it via bundler by adding the following line in your Gemfile
:
Copied to your clipboardgem 'rjmetrics-client'
Now, you can use the library like this:
Copied to your clipboardrequire "rjmetrics_client"client = RJMetricsClient.new(client_id, api_key)# do stuff with client
For more information, check out the source code on Github.