Skip to main content

Installation

Client SDK, a part of Aurora Platform API, is a client-side JavaScript library for building web applications with Aurora's latest computer-aided design technology.

Load Client SDK, attach to the DOM, and load a design. The latest build is located at https://sdk-cdn.aurorasolar.com/client-sdk-loader.next.js.

Browser Support

We currently support the latest versions of Chrome and the latest versions of mobile Safari on iPads. Please reach out to your Aurora Account Executive if you have a need for additional browser support.

Script Tag

<!DOCTYPE html>
<html style="height: 100%; width: 100%">
<head>
<title>Aurora Solar Client SDK Demo</title>
</head>
<body style="height: 100%; width: 100%">
<h3>My Aurora Solar Client SDK Demo</h3>
<!--The div element for the Aurora CAD view -->
<div style="height: 100%; width: 100%" id="cad-element"></div>

<script type="module">
const library = await import('https://sdk-cdn.aurorasolar.com/client-sdk-loader.next.js');

const sdk = await library.load({
token: '<access_token>',
// or just user name and password when testing in sandbox
// username: '<user>',
// password: '<password>',
});

console.log('SDK loaded', sdk);

// Saving to window for testing
window.sdk = sdk;
await sdk.cad.attach('#cad-element');

// Saving to window for testing
window.design = await sdk.design.load('<DESIGN_ID>');
</script>
</body>
</html>

Content Security Policy

If your application uses a Content Security Policy, we advise that you add the following directives to ensure that the SDK loads correctly:

script-src 'self' cad-cdn.aurorasolar.com sdk-cdn.aurorasolar.com;
script-src 'wasm-unsafe-eval';

If you encounter issues loading imagery from different domains, you may need to add the following directive:

img-src 'self' <imagery_domain>;

Imagery may be served from various domains, including but not limited to:

  • Bing: dev.virtualearth.net
  • Google: maps.googleapis.com