timekit-sdk
Version:
JavaScript SDK for the Timekit API (timekit.io)
54 lines (53 loc) • 2.08 kB
HTML
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body {
font-family: helvetica, verdana, arial, sans-serif;
color: #383838;
margin: 30px;
}
code {
font-family: monospace;
}
</style>
</head>
<body>
<h1>Timekit JS SDK vanilla example</h1>
<p>This is the most minimal boilerplate demo of timekit sdk used in the browser. Fire up your console (CMD+ALT+I) and use the SDK by hitting methods on the "timekit" global variable, e.g.</p>
<code>
timekit.configure({<br />
app: 'back-to-the-future',<br />
inputTimestampFormat: 'l h:i a Y-m-d'<br />
});
</code><br /><br />
<code>
timekit.auth({<br />
email: 'doc.brown@timekit.io',<br />
password: 'DeLorean'<br />
}).then(function(response) {<br />
console.log('user authenticated!');<br />
console.log(response);<br />
}).catch(function(response) {<br />
console.log('an error occured!');<br />
console.log(response);<br />
});
</code><br /><br />
<code>
timekit.findTime({<br />
emails: ['doc.brown@timekit.io', 'marty.mcfly@timekit.io'],<br />
future: '3 days',<br />
duration: '30 minutes'<br />
}).then(function(response) {<br />
console.log('find time OK, heres the result:');<br />
console.log(response);<br />
});
</code>
<script src="../../dist/timekit-sdk.js"></script>
</body>
</html>