| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is the JavaScript SDK for Leanplum, allowing developers to access and integrate the functionality of Leanplum with applications and devices through JavaScript and HTML5. Leanplum is an application development platform that provides mobile A/B testing, messaging functionality, personalization, and more features for applications.
Add leanplum.js to your project:
<script type="text/javascript" src="leanplum.js"></script>Initialize Leanplum.
// This value should be set to true only if you're developing on your server.
var isDevelopmentMode = true;
// Sample variables. This can be any JSON object.
var variables = {
items: {
color: 'red',
size: 20,
showBadges: true
},
showAds: true
};
// Insert your API keys here.
if (isDevelopmentMode) {
Leanplum.setAppIdForDevelopmentMode("APP_ID", "DEVELOPMENT_KEY");
} else {
Leanplum.setAppIdForProductionMode("APP_ID", "PRODUCTION_KEY");
}
Leanplum.setVariables(variables);
Leanplum.start(function(success) {
console.log('Success: ', success);
console.log('Variables: ', Leanplum.getVariables());
});Install yarn package manager and run have it install all dependencies.
npm i -g yarn
yarn installRun tests: mocha -r mock-local-storage -r test/specs/helpers/setup.js -r test/specs/helpers/chai.js test/specs/testLeanplum.js
Run: npm i -g nyc nyc mocha -r mock-local-storage -r test/specs/helpers/setup.js -r test/specs/helpers/chai.js test/specs/testLeanplum.js
See LICENSE file.
| Back | FazBrowse Home | New Git URL |