Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@quadient/evolve-realtime-data-api-client

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quadient/evolve-realtime-data-api-client

Library facilitating communication with the Digital Delivery Realtime Data API services.

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-73.33%
Maintainers
5
Weekly downloads
 
Created
Source

Digital Delivery Realtime Data API Example

Overview

This example showcases how to parse a response from the Digital Delivery Realtime Data API.

Pre-requisities

  • Digital Delivery application
  • Realtime Data API enabled with the Native Storage DATA API type - see Documentation
  • Digital Delivery endpoint: {host}/api/query/Messenger/BlobStorageDeltaApiQuery

Cursor Usage Example

// First time we call the API service, we need to provide a timestamp from which we want to list the data.
const date = new Date();
date.setHours(date.getHours() - 24);

const dataApiClient = new RealtimeDataApiClient(dataApiConnector);
const deltaData = await dataApiClient.getDelta(date);
// Save the cursor for the next API call.
const deltaData = await dataApiClient.getDelta(date);
await db.upsert("cursor", deltaData.cursor);
// For subsequent calls, we use the cursor saved from previous call.
const cursor = await db.get("cursor");

const dataApiClient = new RealtimeDataApiClient(dataApiConnector);
const deltaData = await dataApiClient.getDelta(cursor);

Response Parsing Example

const dataApiClient = new RealtimeDataApiClient(dataApiConnector);
const deltaData = await dataApiClient.getDelta(cursor);

for (const item of deltaData.deltaItems) {
    if (item.deltaType === "EmailArchive" && item.customField.startsWith("myJobs")) {
        console.log(item);
    }
}

FAQs

Package last updated on 31 Mar 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc