Use New SDKs Together

by keen

HTML

<script src="https://d26b395fwzu5fz.cloudfront.net/keen-analysis-1.2.2.js"></script>
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-tracking-1.1.2.js"></script>
<script src="https://d26b395fwzu5fz.cloudfront.net/keen-dataviz-1.1.0.js"></script>
<p id="report"></p>

JavaScript

/*
	This is simply a proof-of-concept showing that 
	all 3 new modular SDKs can now be loaded and 
	used together without namespace conflicts, 
	as of the versions listed above.
*/
var client = new Keen({
	projectId: 'YOUR_PROJECT_ID',
  masterKey: 'YOUR_MASTER_KEY',
	readKey: 'YOUR_READ_KEY',
  writeKey: 'YOUR_WRITE_KEY'
});
var str = '';
str += (typeof client.recordEvent === 'function') + ', ';
str += (typeof client.writeKey === 'function') + ', ';
str += (typeof client.masterKey === 'function') + ', ';
str += (typeof client.query === 'function') + ', ';
str += (typeof client.readKey === 'function') + ', ';
str += (typeof Keen.Dataviz.prototype.render === 'function') + ', ';
str += (typeof Keen.Dataset.prototype.set === 'function');
document.getElementById('report').innerHTML = str;

console.log(client);