Node.js¶
Apptimize supports server-side experimentation and release management through several server-oriented SDKs including Node.js.
Our server-side SDKs support programmatic experimentation (Dynamic Variables and Code Blocks) as well as Feature Flags.
EU Cloud Site¶
Use the configAttributes
flag to set your Apptimize region to EUCS if you are integrated in our EU Cloud site.
var apptimizeAppKey = 'YOUR_APP_KEY';
var configAttributes = {
'apptimize_region': 'eucs',
};
Apptimize.setup(apptimizeAppKey, configAttributes);
SDK Installation¶
Sign in to the Apptimize dashboard. You’ll see a welcome page that asks for the name of your app. After entering all your info, you’ll see these installation instructions again.
Install the SDK from the command-line with npm i @apptimize/apptimize-server-sdk
Then, include Apptimize in your app. For example, you can use require
:
var Apptimize = require('@apptimize/apptimize-server-sdk');
You should now have access to all Apptimize APIs.
You can find our latest Node.js API Documentation here.
Our package can be found on npm here.
Initializing Apptimize¶
To initialize Apptimize, make the following call with the App Key associated to your app, which can be found in the Install tab of your Dashboard. Note that setup has to be called for each unique session in which you are using the Apptimize API.
Apptimize.setup("<appkey>");