In case you're not using any JS bundling/compilation technique, the SDK can also be loaded with the traditional <script> tag, as follows:
<script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.js"></script><script src="https://unpkg.com/@aeternity/aepp-sdk@VERSION/dist/aepp-sdk.browser-script.js"></script>...where VERSION is the version number of the SDK you want to use (eg. 4.0.1).
The bundle will assign the SDK to a global var called Ae, and you can use it like so:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<!-- include latest SDK version -->
<script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.js"></script>
<script type="text/javascript">
Ae.Node({ url: 'https://testnet.aeternity.io' }).then(node => {
Ae.Universal({
nodes: [{ name: 'local', instance: node }]
}).then(aeInstance => {
aeInstance.height().then(height => {
console.log("Current Block Height:" + height)
})
})
})
</script>
</body>
</html>Immediately START playing with our latest SDK release in Codepen.