1.11.3 • Published 9 months ago

leanplum-sdk v1.11.3

Weekly downloads
2,646
License
Apache-2.0
Repository
github
Last release
9 months ago

Leanplum -

Leanplum JavaScript SDK

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 a marketing cloud platform that provides A/B testing, messaging, and personalization features for applications.

Installation

As a static script

Add leanplum.js to your project:

<script src="https://unpkg.com/leanplum-sdk@1.3.0/dist/leanplum.min.js"></script>

As a NPM module

  1. Install the package with

    npm install leanplum-sdk
  2. Use the package in your project

    import Leanplum from 'leanplum-sdk';

Usage

// 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());
});

For a complete reference on how to use the Leanplum JavaScript SDK, refer to the developer documentation.

Development

Setup

Install yarn package manager and run have it install all dependencies.

npm i -g yarn
yarn install

Tasks

  • yarn start - Starts Webpack in development/watch mode.
  • yarn lint - Lints all files.
  • yarn build - Builds a distribution version of the library.
  • yarn test - Runs the unit tests.

Contributing

Before making a contribution, please read through the contribution guidelines.

Once you have done that:

  1. Fork the project
  2. Create your feature branch: git checkout -b feature/my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature/my-new-feature
  5. Submit a pull request to the develop branch

Release / Building

git flow release start "NEW_VERSION"
yarn install
./bump_version.sh OLD_VERSION NEW_VERSION
yarn build
yarn test
git flow release finish "NEW_VERSION"

Test Coverage

Run:

yarn test --coverage

License

See the LICENSE file.

1.11.3

9 months ago

1.11.2

9 months ago

1.11.3-develop.1

9 months ago

1.11.2-develop.1

9 months ago

1.11.1-develop.1

10 months ago

1.11.1

10 months ago

1.11.0

1 year ago

1.10.5

2 years ago

1.10.5-develop.2

2 years ago

1.10.5-develop.3

2 years ago

1.10.5-develop.4

2 years ago

1.10.5-develop.5

2 years ago

1.10.4

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.10.1-develop.1

2 years ago

1.10.5-develop.1

2 years ago

1.10.3-develop.1

2 years ago

1.10.2-develop.1

2 years ago

1.10.1

2 years ago

1.10.4-develop.1

2 years ago

1.10.0-develop.2

2 years ago

1.10.0-develop.1

2 years ago

1.9.1-develop.1

2 years ago

1.10.0

2 years ago

1.9.1-develop.2

2 years ago

1.9.0

2 years ago

1.8.5

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

6 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago