Skip to main content
Version: Next

Quick start

Prerequisites πŸ“‹β€‹

Before you begin, ensure you meet the following requirements for using the SkyPath Web SDK:

  • Access to SkyPath NPM package @yamasee/skypath-sdk-web
  • Node.js and NPM installed on your machine
  • Authentication credentials to access the SkyPath platform

Installation πŸ“¦β€‹

To install the SkyPath Web SDK, use your preferred package manager:

npm install @yamasee/skypath-sdk-web

Alternatively, add the dependency into your package.json file:

package.json
{
"dependencies": {
"@yamasee/skypath-sdk-web": "^0.3.0"
}
}
tip

If you encounter any access issues, refer to our troubleshooting guide.

Importing the SDK​

To use the SDK in your project, import it as follows:

import createSkyPathSDK from "@yamasee/skypath-sdk-web";

Initialization πŸ› οΈβ€‹

The createSkyPathSDK function is your entry point for initializing the SDK. It authenticates and configures the SDK with your specific settings.

info

For more details on authentication options, please see the SDK configuration documentation.

The function returns a promise, resolving to an object containing factory functions for various flows (e.g. Nowcasting or Observations).

// Initialize the SDK with your API key and other details
const sdk = await createSkyPathSDK({
apiBaseUrl: "YOUR_API_BASE_URL",
apiKey: "YOUR_API_KEY", // use api key for dev purposes only. for production, use signed auth option. see configuration section for more details.
userId: "YOUR_USER_ID",
companyName: "YOUR_COMPANY_NAME",
});

Usage πŸš€β€‹

Once the SDK is initialized, you can use the returned object to interact with the SkyPath platform. Start by selecting the specific workflow (Flow) you wish to use.

info

For a complete list of available Flows, see the Flows documentation.

For example, let’s initialize the Nowcasting Flow to get predictions of turbulence intensity.

First, initialize the Nowcasting Flow using the createNowcastingFlow factory method:

const nowcastingFlow = sdk.createNowcastingFlow();

Next, subscribe to the onData event to receive real-time data updates:

nowcastingFlow.onData((data) => {
// Your code here
});

To start the flow and begin receiving data, use the start method:

nowcastingFlow.start();

You can update the configuration at any time using updateConfig method. For example, to change the polygon area for which you want to receive predictions:

nowcastingFlow.updateConfig({ polygon });

To pause the flow and stop data updates, use the stop method:

nowcastingFlow.stop();
info

The stop method pauses the flow without terminating it. You can resume the flow anytime by calling start again.

When you're done with the flow, make sure to clean up by calling terminate:

nowcastingFlow.terminate();

✨ Congratulations!

You’ve successfully integrated the SkyPath Web SDK into your project and initialized the Nowcasting Flow to receive real-time turbulence intensity predictions. You can now use this data in your application for visualizations, such as map displays or analytics dashboards.