🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@ogstack/agent-sdk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ogstack/agent-sdk

Agent SDK for communication with OG Stack

1.0.9
latest
Source
npm
Version published
Weekly downloads
5
-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

og-stack-agent-node

SDK to use while enrolling your service to Og Stack.

Build Status

Agent SDK provides utility for secure communication between Og Stack and Enrolled Services.

Installation

Install the dependencies and devDependencies and start the server.

npm i og-stack-agent-node

Development

Setting Up Agent:

await OgStackSdk.configure({
      serviceUrl: "URL of Og Stack BEH",
      serviceName: "init.serviceName",
      sandbox: "init.sandbox",
      serviceProviderName: "init.serviceProviderName",
      configLocation: "Location of config.json (you can keep ignore this if you want to use default location)"
    });

Decrypting the payload:

ogSdk.decryptPayload(req.body);

Decrypting redirect token:

ogSdk.decryptToken(req.query.payload, 'operation | admin')

Publish service "init" event:

ogSdk.publishServiceInit(subscriptionId, serviceId, configUrl, executionContext)

Publish service "ready" event:

ogSdk.publishServiceReady(subscriptionId, serviceId, configUrl, executionContext)

Publish service "metering" event:

payload = {
    Name: "SERVICE_METERING",
    subscriptionId: subscriptionId,
    serviceId: serviceId,
    txnValue: parseInt(txnValue),
    executionContext: subscriptionData.executionContext,
    eventName: 'e-payments',
};
ogSdk.publishTransactionEvent(payload)

Building for source

For build:

npm run build

FAQs

Package last updated on 13 Jul 2023

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