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/connect-react-sdk

v0.3.3

Published

The Synqly Connect React SDK provides convenient hooks for managing integrations using Synqly Connect.

Downloads

208

Readme

Synqly Connect React SDK

The Synqly Connect React SDK provides convenient hooks for managing integrations using Synqly Connect.

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.

Installation

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

npm install @synqly/connect-react-sdk

Usage

The Synqly Connect React SDK consists of a single hook:

  • useIntegrationPoint: high-level hook used to interface with Synqly Connect for managing integrations and providing utilities for embedding Synqly Connect into your application

[!TIP] For examples on how to use this library in an application, please see: https://github.com/Synqly/examples/tree/main/connect

In order to use this hook, you will need to provide an organization access token. More information about authentication is available in the Synqly API documentation.

useIntegrationPoint

This high-level hook provides you with all relevant data for a given integration, as well as functions to open a Connect session for your end-users to manage their integrations.

To use this hook you must provide the id or name of an integration point, as well as a token with relevant access.

[!CAUTION] The token should be limited in scope as much as possible, so that it's appropriate for use in an end-user browser environment. To help with this, please review the Token Exchange API. We recommend using the connect-ui permission set when working with Connect UI.

Example:

function NotificationsIntegrationCard({ accountId, token }) {
  const integrationPoint = useIntegrationPoint('app-notifications', token, {
    account: accountId,
  })

  const {
    integrations: [integration],
    connect,
    disconnect,
    isLoading,
  } = integrationPoint

  const handleClick = useCallback(() => {
    return integration ? disconnect() : connect({ type: 'tab' })
  }, [connect, disconnect])

  return (
    <div className="integration-card">
      <h1>Application Notifications</h1>
      <p>
        Integrate with your favorite notifications provider to receive updates
        from our app!
      </p>
      <button type="button" disabled={isLoading} onClick={handleClick}>
        {integration ? 'Disconnect' : 'Connect'}
      </button>
    </div>
  )
}

[!TIP] The hooks use smart data fetching and will by default revalidate the data as needed. The default settings can be overridden for greater control over the data fetching process.