Skip to content

Import script tag

Browser bundle

In case you're not using any JS bundling/compilation technnique, the SDK can also be loaded with the traditional <script> tag, as follows:

Latest SDK version

<script src="https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.js"></script>

Specific SDK version

<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).

Browser <script> tag

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://sdk-testnet.aepps.com' }).then(node => {
        Ae.Wallet({
              nodes: [{ name: 'local', instance: node }]
            }).then(aeInstance => {
              aeInstance.height().then(height => {
                console.log("Current Block Height:" + height)
              })
            })
    })
  </script>
</body>
</html>

CodePen Example

Immediately START playing with our latest SDK release in Codepen.