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

    6.3.0 • Public • Published

    @corva/node-sdk

    Corva node-sdk is a framework for building Corva DevCenter apps.

    Contents

    Requirements

    Quick start

    Install

    With npm (bundled with NodeJs, see docs):

    $ npm i @corva/node-sdk

    With yarn (docs):

    $ yarn add @corva/node-sdk

    With pnpm (docs):

    $ pnpm add @corva/node-sdk

    Create an app

    A minimal app should export a handler that match one defined in your manifest.json:

    const { Corva } = require('@corva/node-sdk`);
    
    exports.handler = new Corva().task((event) => console.log(event));

    For details on app types see App types.

    App types

    There are next app types that you can build:

    • Stream - works with real-time data;
    • Scheduled - works with data at defined schedules/intervals (e.g., once a minute, once every 3 ft.);
    • Task - works with data on-demand.

    Writing a handler

    To implement an app with node-sdk you have to write a handler function which accepts two arguments:

    • event - an event itself, see Events;
    • context - helpers that bound to app execution's context, see Context.

    Handler example

    const handler = (event, context) => {
        console.log(event, context);
    }

    Event

    There are next types of events that are matching the related app types:

    Context

    Context provides next functionality:

    • cache - convenient methods to work with state, see State class. Not available for task apps;
    • api - helper to interact with Corva API (and make any other generic request as well), see Api;
    • logger - Logger instance;
    • secrets - application's sensitive data (see DevCenter docs, usage example, testing);
    • config - some basic info about app invoke.

    Keywords

    Install

    npm i @corva/node-sdk

    DownloadsWeekly Downloads

    49

    Version

    6.3.0

    License

    UNLICENSED

    Unpacked Size

    139 kB

    Total Files

    107

    Last publish

    Collaborators

    • andysem
    • ryandawson
    • bestfit
    • oleksandr_krupko
    • villeti
    • jordanambra
    • dumavit1
    • semykin
    • antonpyrlyk
    • borisatcorva
    • corva-devops-automation