JSPM

  • Created
  • Published
  • Downloads 144
  • Score
    100M100P100Q130786F
  • License GPL-2.0-only

Actyx SDK

Package Exports

  • @actyx/sdk
  • @actyx/sdk/lib/index.js
  • @actyx/sdk/lib/snapshotStore
  • @actyx/sdk/lib/snapshotStore/index.js
  • @actyx/sdk/lib/util
  • @actyx/sdk/lib/util/index.js
  • @actyx/sdk/lib/util/logging
  • @actyx/sdk/lib/util/logging.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@actyx/sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Actyx Typescript/Javascript SDK



A open-source Typescript/Javascript SDK for interacting the Actyx APIs:

  • Emit, query, and subscribe to events that get distributed via Actyx
  • Get Actyx diagnostics
  • Scoped to your custom app id

This SDK is the basis for the more frequently used Actyx Pond framework.

Example usage

import { Actyx, Tags } from '@actyx/sdk'

(async () => {

    // Connect to the local Actyx process
    const actyx = await Actyx.of({
        appId: 'com.example.app',
        displayName: 'Example App',
        version: '1.0.0'
    })

    // Get latest event stream offsets
    const offsets = await actyx.offsets()
    console.log(offsets)

    // Emit events
    await actyx.emit([
        {
            tags: ['tag-1', 'tag-2'],
            event: {
                foo: 'bar'
            }
        }
    ])

    // Subscribe to events
    await actyx.subscribe({
        query: Tags('tag-1').and('tag-2')
    }, event => {
        console.log(event)
    })
})()