npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@synqly/client-sdk

v0.12.1

Published

The Synqly Client SDK provides access to the Synqly API from JavaScript/TypeScript environments, such as Node or a web browser.

Downloads

148

Readme

Synqly Client SDK

The Synqly Client SDK provides access to the Synqly API from JavaScript/TypeScript environments, such as Node or a web browser.

To use this SDK you must have access to a Synqly organization. If you aren't yet a Synqly customer and like to know more, please contact us to schedule a demo.

Documentation

API reference documentation is available at https://docs.synqly.com.

Installation

Use your favorite package manager to install @synqly/connect-react-sdk:

npm install @synqly/connect-react-sdk

Usage

The Synqly Client SDK consists of two clients:

  • Management: used to manage your Synqly organization
  • Engine: used to interact with configured integrations using Synqly connectors

Both clients are instantiated similarly, but require different kinds of access tokens to work.

The Management client requires an organization token. The organization token can be reset from the Synqly Management Console.

The Engine client requires integration tokens, which are issued when first creating an integration. They can also be reset using an organization token.

More information about authentication is available in the Synqly API documentation.

To instantiate the clients, you must provide a valid token:

import { EngineClient, ManagementClient }
from '@synqly/client-sdk'

// The management client is used to manage your Synqly organization
const management = new ManagementClient({ token: 'ORGANIZATION_TOKEN', })

// The engine client is used to interact with a single integration. To
// interact with multiple integrations you must create a new client for
// each.
const engine = new EngineClient({ token: 'INTEGRATION_TOKEN' })

[!TIP] Instantiating a new client is cheap and has no side-effects. It is often more convenient to create a new client than keep instances around.

Using the Management Client

The Management client is used to manage details about your organization, such as inviting members or creating integrations.

[!NOTE] Creating integrations using this client however requires having full details of your tenant's provider details. To make this easier to maintain, and to reduce the complexities of gathering and maintaining all of this data, Synqly offers Connect UI – a hosted experience that can be embedded right into your app.

Everything you can do with the [Synqly Management Console] (https://app.synqly.com) can be done with the Management client.

Using the Engine Client

The Engine client is used to interact with individual integrations. You must create a new client for each integration you wish to use, as the required token parameter is used to authenticate requests for a single integration.

Each integration is of a specific Connector type, and the Engine client namespaces all Connector APIs making it trivial to deconstruct the relevant connect API for your integration.

Here's an example of how you may use a SIEM integration:

const { siem } = new Engine({ token: 'INTEGRATION_TOKEN' })

siem.postEvents(event)

Responses & Errors

Both the Management and Engine clients return a result object regardless of whether it was successful or not. If it's successful, the body of the response will be available in the body field. If not, the error will be available in the error field.

The body and error fields are mutually exclusive, you will never receive both a body and an error at the same time. This allows you to deal with the result without having to wrap any calls in try/catch blocks.

Here's an example of creating an account:

const { body, error } = await management.accounts.create({ fullname })

if (error) {
  // Handle the error however you please, here we just throw it.
  throw errror
}

// The `body` field is guaranteed to exist at this point, since `body` and
// `error` are mutually exclusive fields on the response object.
const { account } = body.result

API Reference.

API Documentation

Both the Management and Engine clients are generated from our OpenAPI specification. All operations in the reference documentation are available in this SDK.

Contributing

We greatly appreciate open-source contributions, however the majority of this library is generated programmatically. Changes made to this repository are likely to be overwritten by the next release. We do welcome PRs and issues however, even if they may not be merged directly.