New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@basaldev/nodeblocks-cloud-sdk

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@basaldev/nodeblocks-cloud-sdk

Nodeblocks cloud SDK

latest
npmnpm
Version
0.7.0
Version published
Maintainers
7
Created
Source

Nodeblocks Cloud SDK

Nodeblocks Cloud SDK for creating the custom adapter.

🧑‍💻 For the user who use this SDK

Installation

You need npm token to install the package. Contact to the Nodeblocks team to get the token.

npm i @basaldev/nodeblocks-cloud-sdk

Configuration

We recommend to create the configuration files below by running nbc adapter dev interactively.

Create nbc.sdk.json file in the root directory and add the following configuration to specify the service and the version of the adapter.

cp nbc.sdk.json.default nbc.sdk.json
{
  "adapter":{
    "service":"auth|user|organization|catalog|order|review|chat|notification",
    "version":"x.x.x"
  }
}

Create a .env.${service} file in the root directory and add the following configuration to pass the configs to the service and the adapter.

cp .env.default .env.${service}
ADAPTER_PACKAGE_NAME=`Absolute path to the adapter package`
PORT=8080
NODE_ENV=production
SERVICE_XXXX=`Service configuration (depends on the service)`
...
ADAPTER_XXXX=`Adapter configuration (depends on the service and the adapter)`
...

Commands

Start the development server to develop the custom adapter

nbc adapter dev

Start the server with the custom adapter

nbc adapter start

👮‍♀️ For the developers who develop this SDK

Installation

npm ci

Commands

Fetch the latest service templates

In the root directory, create a file called nbc.sdk.json and add the following configuration:

{
  "backendRepo": "git@github.com:basaldev/nodeblocks-cloud-backend.git"
}

To fetch the latest templates from backend repository, run the following command:

npm run templates:fetch

By default, it fetches from the default branch. You can specify the branch as follows:

{
  "backendRepo":{
    "url": "git@github.com:basaldev/nodeblocks-cloud-backend.git",
    "branch": "develop"
}

Testing

To test the SDK command locally, use /test folder. First create pack file for the SDK:

npm pack

This will create a file called basaldev-nodeblocks-cloud-sdk-x.x.x.tgz in the root directory.

In package.json of the test folder, update the dependencies to use the local package and npm i --no-save to install the package.

// Change x.x.x to the version of the package
"dependencies": {
  "@basaldev/nodeblocks-cloud-sdk": "file:../basaldev-nodeblocks-cloud-sdk-x.x.x.tgz"
}

Then, run the scripts you want like npm run adapter:dev to test there.

You should delete ADAPTER_PACKAGE_NAME from .env.${service} file not to use the custom adapter.

Publish the package

Upgrade the version in package.json file.

Run the following command to publish the package:

npm publish

FAQs

Package last updated on 01 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts