SDK/Library Integration

The following section lists the available integrations inside Cloud Flow''s Node.js environment. Please use the link provided under each listing for more information and documentation.


openai

const { OpenAIApi, Configuration } = require('openai');

The openai Node.js library is designed for interacting with the OpenAI API. It facilitates access to various AI models developed by OpenAI, such as GPT-4, which are known for their advanced natural language processing capabilities. Key features include:

  1. AI Model Integration: You can leverage the OpenAI API to integrate AI functionalities like text generation, translation, summarization, and other language processing tasks into your Zingy applications.

  2. Ease of Use: The package is designed to be straightforward, allowing for easy integration of OpenAI's powerful AI capabilities.

  3. Versatile Application: It's suitable for a range of applications, from building chatbots and automated content generators to implementing advanced language analysis and processing tools.


googleapis

const { google } = require('googleapis');

The googleapis Node.js library is used for interacting with various Google APIs. It offers a streamlined way to access and use a wide range of Google services from Zingy applications. Key features include:

  1. Wide Range of Google APIs: Support for numerous Google services, enabling you to interact with APIs such as Google Drive, Gmail, Google Calendar, and many others.

  2. Authentication and Authorization: It includes robust support for authentication and authorization with OAuth 2.0, API Keys, and JWT (JSON Web Tokens). This makes it easier to securely access user data and Google services.

  3. Ease of Use: The library is designed to simplify the process of making requests to Google APIs, handling much of the complexity associated with these tasks.


twilio

Zingy provides a No-Code solution to use Twilio's messaging services via the Twilio connection.

The twilio Node.js library is used for integrating Twilio services into Zingy applications. Twilio is a cloud communications platform that provides APIs for messaging, voice, video, and other communication services.

Use this library for accessing advanced features or for custom implementations beyond what is offered via the Twilio connection .

The example below creates a seperate Twilio client by specifying account credentials:

// To create a new twilio client specifying account credentials
const client = require('twilio')(accountSid, authToken);

To use a Twilio client initialized with credentials specified in a Twilio connection see the following example:

// To use a twilio client initialized with credentials
// provided in a Twilio connection
const client = zingyConn.twilio(connectionName);

After the client object is initialized, you can use it to call into the Twilio library.


aws-sdk

const AWS = require('aws-sdk');

The aws-sdk Node.js library is the official Amazon Web Services (AWS) SDK for JavaScript, providing a robust and convenient way to interact with AWS services from your Zingy applications. Here's a brief overview:

  1. Versioning: This is the 2.x version of the SDK. The latest and recommended version of the AWS SDK for JavaScript is version 3.x (see @aws-sdk/client-s3 below), which has been generally available since December 2020. Version 3.x offers various improvements and new features compared to the earlier 2.x versions.

  2. Features: This SDK provides JavaScript objects for AWS services including but not limited to Amazon S3, EC2, DynamoDB, and Lambda. It allows you to access and manage AWS resources programmatically.


@aws-sdk/client-s3

The @aws-sdk/client-s3 Node.js library is a modular part of the AWS SDK version 3.x for JavaScript, specifically tailored for Amazon S3 (Simple Storage Service) operations.

Usage: To use this package, you import the S3Client and the specific commands you need. For instance, to list buckets, you would use the ListBucketsCommand:

const { S3Client, ListBucketsCommand } = require("@aws-sdk/client-s3");

stripe

Zingy provides a No-Code solution to use Stripe via the Stripe connection.

The stripe Node.js library provides access to the Stripe API, which is used for integrating payment processing solutions into Zingy applications.

Use this library for accessing advanced features or for custom implementations beyond what is offered via the Stripe connection.

The example below creates a seperate Stripe client by specifying account credentials:

// To create a new stripe client specifying account credentials
const stripe = require('stripe')(secret);

To use a Stripe client initialized with credentials specified in a Stripe connection see the following example:

// To use a stripe client initialized with credentials
// provided in a Stripe connection
const stripe = zingyConn.stripe(connectionName);

After the stripe object is initialized, you can use it to call into the Stripe library.


@sendgrid/mail

Zingy provides a No-Code solution to Sendgrid via the Sendgrid connection.

The @sendgrid/mail Node.js library is used for integrating the Twilio Sendgrid email service into Zingy applications.

Use this library for accessing advanced features or for custom implementations beyond what is offered via the Sendgrid connection.

The example below creates a seperate Sendgrid client by specifying account credentials:

const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(apiKey);

To use a Sendgrid client initialized with credentials specified in a Sendgrid connection see the following example:

// To use a sendgrid client initialized with credentials
// provided in a Sendgrid connection
const sgMail = zingyConn.sendgrid(connectionName);

After the sgMail object is initialized, you can use it to call into the Sendgrid library.


@sendgrid/client

The @sendgrid/client Node.js library allows access to all Twilio Sendgrid v3 API endpoints beyond what's offered by the @sendgrid/mail library.

Use this library for a wide range of email-related operations, including managing lists and contacts, handling email statistics and reports, etc.

const client = require('@sendgrid/client');
client.setApiKey(apiKey);

After the client object is initialized, you can use it to call into the library.


axios

const axios = require('axios');

The axios Node.js library is a promise-based HTTP client for Node.js. It is widely used for making HTTP requests to external resources, offering a clean and simple API for fetching and handling data. Here are some key features of Axios:

  1. Promise-Based: Axios returns promises, making it compatible with modern JavaScript async/await syntax, which simplifies handling asynchronous operations.

  2. Interceptors: It allows you to intercept request and response operations globally, which is useful for logging, authentication, or any other repetitive task.

  3. Automatic Transformations: Axios automatically transforms JSON data, both on the request side (sending data) and on the response side (receiving data).

  4. Request Cancellation: It supports request cancellation, enabling you to cancel requests according to certain conditions, which can be essential for performance optimization.

  5. Response Timeout: You can configure a response timeout to abort requests that take too long, which is useful in preventing long waiting times in your application.

  6. Wide Range of HTTP Requests: Axios supports all standard HTTP requests (GET, POST, PUT, DELETE, etc.) and allows for easy customization of request headers.

  7. Error Handling: Axios has a robust method of handling errors, making it easier to debug issues in HTTP requests and responses.


csv-parser

const csv = require('csv-parser');

The csv-parser Node.js library is a streaming CSV parser designed for high-speed processing and compatibility with various CSV formats. Here are some key aspects:

  1. High Performance: It can convert CSV data to JSON at a rate of approximately 90,000 rows per second, although performance can vary depending on the data.

  2. Compatibility: csv-parser aims to be compatible with a wide range of CSV data formats, as tested against the csv-spectrum CSV acid test suite.

  3. To use csv-parser, you typically create a readable stream for the CSV data, instantiate the csv-parser, and then pipe the stream through it for processing.


xml2js

const xml2js = require('xml2js');

The xml2js Node.js library is a simple and efficient tool for converting XML data to JavaScript objects and vice versa, supporting bi-directional conversion. It is particularly useful in applications where there is a need to work with XML data formats within a JavaScript or Node.js environment.


cheerio

const cheerio = require('cheerio');

The cheerio Node.js library is used for parsing, manipulating, and rendering HTML or XML documents. Here are some key features:

  1. jQuery-like Syntax: Cheerio implements a subset of core jQuery, allowing developers who are familiar with jQuery to easily use Cheerio for server-side DOM manipulation.

  2. Efficient DOM Manipulation: It removes all the DOM inconsistencies and browser-specific aspects from the jQuery library, providing a clean and consistent API for server-side usage.

  3. Performance: Cheerio is known for its performance, as it works with a very simple and consistent DOM model, making parsing, manipulating, and rendering operations incredibly efficient.

  4. Use Cases: It is widely used for web scraping, data extraction, and server-side DOM manipulation where jQuery-like syntax is preferred.


node-ssh

const { NodeSSH } = require('node-ssh');
const ssh = new NodeSSH();

The node-ssh Node.js library offers a simplified API for common SSH tasks, such as executing commands on a remote server, automate command-line interactions, like deploying applications, running remote scripts, or managing servers programmatically from a Zingy application.


moment

Zingy offers a No-Code solution for Date/Time manipulation via various Page Flow and Cloud Flow blocks.

The moment Node.js library provides a comprehensive set of tools for parsing, validating, manipulating, and formatting dates.

Here's a brief overview:

  • Date Handling: Moment.js simplifies complex date operations like date arithmetic, parsing, and formatting, making it easier to work with dates and times in JavaScript.

  • Functions: It includes various functionalities such as comparison of dates, manipulation of date components (like adding days, months, years), and formatting dates in human-readable forms.


tinify

const tinify = require('tinify');

The tinify Node.js library is a client for the Tinify API, primarily known for its intelligent image compression capabilities. Here's a brief overview:

  • Functionality: The main feature of tinify is to compress images. It supports intelligent compression, which optimizes images without significant loss of quality.

  • Tinify API: The package acts as a Node.js client for the Tinify API, which is the underlying service that powers TinyPNG and TinyJPG, popular online image compression tools.


Node.js modules

Util

const util = require('util');

The util module in Node.js is a core module that provides a collection of utility functions useful for various purposes. It is primarily used to assist in the development process, providing functions that are often needed in many programming scenarios. Here are some of the key features and functionalities provided by the util module:

  1. Promisification: One of the most useful features of the util module is util.promisify. This function converts a regular Node.js callback-style function into a function that returns a promise. This is particularly helpful for working with newer async/await syntax in Node.js.

  2. Format Strings: The util.format method provides a way to format strings similar to printf in C. It allows for formatting a string with placeholders that are replaced by provided arguments.

  3. Text Encoding: Functions like util.TextEncoder and util.TextDecoder are available for encoding and decoding text, respectively. These are implementations of the WHATWG Encoding API.

URL

const url = require('url');

The URL module in Node.js provides utilities for URL resolution and parsing. It is a core module of Node.js and includes functionality for handling and manipulating URL strings. Here are some of the key features of the URL module:

  1. Parsing URLs: The module can parse a URL string into its constituent parts (like protocol, host, pathname, search, and hash) and provides an easy way to access these individual components.

  2. Creating URL Objects: It allows for the creation of URL objects from a string representation. These objects provide properties and methods to read and modify different parts of the URL.

  3. URL Resolution: The module can resolve a target URL relative to a base URL, which is useful for dealing with relative URLs.

  4. Encoding and Decoding: It provides utilities for URL encoding and decoding, which is important for handling special characters in URL components.

  5. Legacy API: The URL module includes a legacy url.parse and url.format API for backward compatibility, although the newer WHATWG URL API is recommended for most use cases.

  6. WHATWG URL API: This newer API is aligned with the URL standard by WHATWG and provides more robust and flexible URL parsing and formatting capabilities.

Readline

const readline = require('readline');

The Readline module in Node.js is a core module that provides an interface for reading data from a Readable stream one line at a time. Here’s an overview of its key features and functionalities:

  1. Line-by-Line Input: The primary use of the Readline module is to read input from the user line by line. It listens for the 'line' event, which is emitted whenever the input stream receives an end-of-line input (, , or \r).

  2. Input and Output Streams: The module can be attached to any instance of stream.Readable and stream.Writable .

String decoder

const StringDecoder = require('string_decoder').StringDecoder;

The string_decoder module in Node.js is a core module used for decoding buffer objects into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 characters. This module is particularly useful when you are working with streams of binary data that need to be converted into strings, ensuring that character encoding is handled correctly.

  1. Handling Multi-byte Characters: The primary use of the string_decoder module is to ensure that multi-byte characters are not mangled when converting a buffer to a string. When dealing with streams of data, a multi-byte character might be split across multiple buffers. The string_decoder module ensures these characters are properly reconstructed without any loss or corruption.

  2. Support for Popular Encodings: It supports popular character encodings like UTF-8, Base64, and UTF-16LE (UTF-16 Little Endian).

  3. Simple Interface: The module provides a simple API, with the main class being StringDecoder

Stream

const stream = require('stream');

In Node.js, the stream module provides an API for handling streaming data. Streams are collections of data that might not be available all at once and don't need to fit in memory. This makes them particularly useful for processing large amounts of data or data that's coming from an external source one piece at a time.

Use the stream module to create custom streams using the base stream classes (stream.Readable, stream.Writable, stream.Duplex, stream.Transform) to create custom stream implementations.

Last updated