TypeScript / JavaScript SDK

Overview

The generated Neurelo TypeScript/JavaScript for NodeJS SDK provides easy access to your Neurelo APIs for your applications.

Installation

Getting Started

Neurelo's TypeScript / JavaScript SDK expects two environment variables to be configured:

  • NEURELO_API_BASE_PATH

    • This is the endpoint for the region where your environment is running, for example, if your environment is running in Neurelo's us-east-2 gateway, the value for this variable should be https://us-east-2.aws.neurelo.com

  • NEURELO_API_KEY

    • This is the API key generated for your environment under the API Keys tab.

Replacing or modifying Neurelo's HTTP Client

To replace Neurelo's Axios client, you can create a neurelo.config.ts or neurelo.config.js file in your project's root directory. The configuration file should export a named variable called customAxios with your new Axios instance.

Once you've installed and configured your Neurelo SDK, you're ready to import the generated services into your application for use.

For example, if a data definition had an Address object present, we would be able to import the AddressApiService and utilize various methods to interact with the application's data, as is shown below:

import { AddressApiService } from 'neurelo-sdk';

try {
    const response = await AddressApiService.findAddress();
    const addresses = response.data.data;
    
    console.log(addresses);
} catch (error) {
    console.error('Failed to retrieve list of addresses', error);
}

For further documentation on the operations available for each of your objects, or how to construct parameters like Select or Where inputs, please see the documentation available inside the 'Docs' tab under the 'Definitions', or under the 'APIs' tab of the 'Environments' of your project

Last updated