@liquidcommercedev/rmn-sdk v1.4.6
LiquidCommerce RMN SDK
The Liquid Commerce RMN SDK provides an easier way to interact with our Retail Media Network APIs through a server-side SDK for Node.js and Web JS script (more libraries will soon follow).
Overview
The RMN SDK is bundled for use with both import/require , if you need the client side use the script below, compiled down to ES2015.
<script src="https://js.liquidcommerce.co/sdk/v1"></script>
Method | Description |
---|---|
spotSelection({}) | A sample authenticated interaction with our Decision API that receives custom personalized ADs using machine learning and event based data. |
createSpotElement({}) | A simple method that makes your life easier by creating the spot element ready for injection anywhere in your site. |
METHODS
Authentication
The Liquid Commerce library provides convenient, secure, and encrypted access to our Liquid Commerce methods through API Key authentication.
Installation
Install the package with:
npm install @liquidcommercedev/rmn-sdk
# or
yarn add @liquidcommercedev/rmn-sdk
The Liquid Commerce methods use API keys to authenticate requests. You can request your keys from your Partnerships liaison.
Development mode secret keys have the prefix dev and Production ready secret keys have the prefix prod.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Once you create a new instance of the LiquidCommerce() library it will generate an access token that then automatically attaches to each request, the access token has a 1hour expiry that continues to refresh on each call. If an hour has passed without using the token, you must authenticate again to fetch a fresh access token.
All API requests in production must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
ALL LIVE/PRODUCTION API REQUESTS AND RESPONSES ARE ENCRYPTED IN TRANSMISSION.
const RmnClient = require('@liquidcommercedev/rmn-sdk');
For ES modules and async/await:
import { RmnClient } from '@liquidcommercedev/rmn-sdk';
Usage
import { RmnClient } from '@liquidcommercedev/rmn-sdk';
// Your Account token provided to you through your account representative
const client = await RmnClient('YOUR_API_KEY', {
env: 'staging'
});
Selection
A sample authenticated interaction with our Decision API that receives custom personalized ADs using machine learning and event based data.
Sample Spot Selection
An example use case for LiquidCommerce's spotSelection({})
method.
import RmnClient from '@liquidcommercedev/rmn-sdk';
// Your Account token provided to you through your account representative
const client = await RmnClient('YOUR_API_KEY', {
env: 'staging'
});
const spots = await client.spotSelection({
"spots": ['billboard', 'leaderboard']
});
console.log({ spots });
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago