@embedhq/react
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

Embed Connect React SDK

This SDK makes it easy to connect end-user accounts to integrations like Dropbox, Slack, HubSpot, and more. For a detailed overview of the auth flow, refer to the docs. If you're not using React (or a React-based framework like Next.js), use the JavaScript SDK instead.

npm latest package

Visit the Embed website ▸

Read the documentation ▸

View the API reference ▸

Installation

Download the SDK from NPM.

npm install @embedhq/react

Usage

First, generate a session token server-side, then use it to call the connect() function exposed by the useEmbedConnect hook as shown below.

import { useEmbedConnect } from "@embedhq/react";

export function MyComponent() {
  const { connect } = useEmbedConnect();

  async function initiateAuthFlow() {
    try {
      const response = await connect("SESSION_TOKEN");
      console.log(response.connectionId);
    } catch (err) {
      console.error(err);
    }
  }

  return <button onClick={initiateAuthFlow}>Connect</button>;
}

Readme

Keywords

none

Package Sidebar

Install

npm i @embedhq/react

Weekly Downloads

2

Version

0.1.5

License

none

Unpacked Size

14.6 kB

Total Files

10

Last publish

Collaborators

  • useembed