Skip to main content
Version: LOC v0.8 (legacy)

Introduction

LOC SDK is a downloadable NPM package that defines the interfaces of data context as well as agents - a series of features provided by LOC's logic runtime that can read and/or write internal and external storages.

The data context contains the following features:

The following agents can be imported:

info

This section is currently based on SDK v0.8.0 (which is used for LOC Core v0.8.0 and Studio v1.3.0).

Supported logic code languages/version:

  • JavaScript ES6/ES2015 and above
  • TypeScript 3.7.0 and above

You do not need to install SDK in Studio. For installing SDK in CLI workspaces, see Install SDK and Dependencies.

Some of the agents require agent configuration. See tutorial for details.

How to Import Agents

From v0.7.0 all logic have to explicitly import agents and related classes from LOC SDK using ECMAScript 6 imports. Below is a short demostration:

tip

If you are using LOC Studio, the imports will be automatically added in the code blocks.

Logic
import {
LoggingAgent,
SessionStorageAgent,
EventAgent,
} from "@fstnetwork/loc-logic-sdk";

export async function run(ctx) {
// ...
}

Agent Configuration

Four of the agents - HTTP, database, file storage and mail - requires agent configuration to connect external data sources. You can set them either via Studio.