Skip to main content
Version: Next

Configuration

Overview 🌐

The SkyPath Web SDK is a powerful tool for accessing and visualizing weather and turbulence data on a geographic map. To use the SDK effectively, you need to provide configuration and authentication parameters to access the SkyPath platform. This guide outlines the necessary steps to configure the SDK and authenticate with the SkyPath API.

Configuration Parameters 🔧

The SDK requires two key sets of parameters for setup: general configuration and authentication.

const sdk = createSkyPathSDK({
...generalConfig, // General configuration parameters
...authConfig, // Authentication parameters
});

General

These parameters define core settings, such as the base URL for accessing the SkyPath API:

  • SkyPath Base URL: Optional setting for specifying the SkyPath API base URL. If not provided, default is production URL https://api.skypath.io.

You may need to define a custom base URL if you're using a proxy server or a different API endpoint.

const generalConfig = {
apiBaseUrl: "https://api.skypath.io", // or https://staging-api.skypath.io for testing
};

Authentication 🔑

The type of authentication parameters you'll provide depends on the authentication method you select. The SDK supports two primary methods:

  • Signed JWT (JSON Web Token): Provides secure user authentication.
  • API Key: Grants access in a simple way through an API key.
info

To use either method, you must have a valid SkyPath API key. If you do not yet have an API key, please contact us.

Option 1: Signed JWT

The Signed JWT method offers a secure way to authenticate users and authorize access. You will need to generate a signed JWT using your SkyPath API key.

Generating a signed JWT may involve fetching the token from your authentication server or an external service. The SDK uses an asynchronous function to handle the retrieval of the JWT and partner ID.

const authConfig = {
authCallback: async () => {
// Logic to retrieve the signed JWT and partner ID
return {
jwt: "XXXX-XXXX-XXXX-XXXX", // Your signed JWT
partnerId: "sample-partner-id", // Your partner ID
};
},
};
info

The authCallback function should return an object containing both the jwt (signed JWT) and partnerId. These values are essential for authenticating access to the SkyPath platform.

Option 2: API Key

With this option, you directly use the API Key to authenticate the user, alongside additional required parameters.

info

This method is recommended primarily for development, testing, or demonstration purposes. For production environments, we highly recommend using the Signed JWT method for enhanced security.

const authConfig = {
apiKey: "XXXX-XXXX-XXXX-XXXX", // Your SkyPath API key
userId: "sample-user-id", // Your user ID
companyName: "sample-company-name", // Your company name
};

By following the above guidelines, you can configure the SkyPath Web SDK to securely access the platform's weather and turbulence data. Whether you're using the Signed JWT for secure production usage or the API Key for testing, these configurations ensure seamless integration with the SkyPath API.