@cerebruminc/neuron-sdk
TypeScript icon, indicating that this package has built-in type declarations

11.17.2 • Public • Published

neuron-sdk

DO NOT EDIT src folder. This is autogenerated sdk based on neuron-api.yaml file. this uses openapi-generator to generate sdk.

Documentation

Documentation for the SDK is generated automatically using Typedoc and can be found here: https://cerebruminc.github.io/neuron-sdk.

consuming

  1. run yarn/npm install in the project where you want to use
npm install @cerebruminc/neuron-sdk

or

yarn add @cerebruminc/neuron-sdk
  1. intialize sdk
import { Configuration, NeuronApi } from "@cerebruminc/neuron-sdk";

export const neuronSdk = new NeuronApi(
  new Configuration({
    basePath: NEURON_API_BASE_URL as string,
    baseOptions: {
      withCredentials: true,
    },
  })
);
  1. use sdk functions
await neuronSdk.getSession();

how to update sdk

  1. run neuron api
  2. hit /api-yaml endpoint which will download yml file
  3. replace that yml file content into neuron-api.yaml file in this repo
  4. do yarn build which will generated latest sdk from yaml file
  5. To publish, follow publishing guide below.

Building with Docker

If you don't have a Java runtime environment on your workstation, or you want to run the build in an isolated environment, you can use the openapitools Docker image to build the SDK.

docker run --rm \
    -v $PWD:/local openapitools/openapi-generator-cli:v6.2.0 generate \
    -i /local/neuron-api.yaml \
    -g typescript-axios \
    -o /local/src \
    --skip-validate-spec

developing

  1. do yarn in neuron-sdk
  2. do yarn dev which will watch for any files changes and recompiles files
  3. do yalc link neuron-sdk in the project where you want to use this sdk
  4. to generate sdk from neuron-api.yaml run yarn generate-sdk command.

publishing

  • do npm version <major|minor|patch|specific version>
  • do npm publish which will build the sdk and publish to npm. ( to run this successfully, one will need publish access key which you can find from 1password )

Readme

Keywords

none

Package Sidebar

Install

npm i @cerebruminc/neuron-sdk

Weekly Downloads

850

Version

11.17.2

License

ISC

Unpacked Size

372 kB

Total Files

22

Last publish

Collaborators

  • rennen
  • tuliomitre
  • lucianbuzzo
  • sebmellen
  • shubham0850
  • davesauce
  • byennen
  • sarjuhansaliya
  • lanceennen