Socket
Socket
Sign inDemoInstall

react-inbox-link

Package Overview
Dependencies
6
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-inbox-link

React bindings for the LinkToInbox API


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

The React bindings for the LinkToInbox.com API offering both component and hook interfaces encapsulating the standard Web Component and JavaScript API interfaces respectively.

This package also has TypeScript support for a smoother integration.

npm install react-inbox-link

Usage

The component API:

import { InboxLink } from 'react-inbox-link'

function Example() {
  return (
    <InboxLink
      publishableKey="pk_YOUR_KEY"
      recipientAddress="user@example.com"
    />
  )
}

The hook API:

import { useInboxLink } from 'react-inbox-link'

function Example() {
  const inboxLink = useInboxLink('pk_YOUR_KEY', {
    recipientAddress: 'user@example.com',
  })

  switch (inboxLink.type) {
    case 'loading':
      return <p>Loading…</p>
    case 'link_not_available':
      if (inboxLink.error) {
        console.error(inboxLink.error)
      }
      return null
    case 'link_data':
      const { link, icon, providerName } = inboxLink.data
    // Render how you'd like
  }
}

Keywords

FAQs

Last updated on 01 Oct 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc