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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@straddleio/bridge-react

v0.1.15

Published

`@straddleio/bridge-react` is a React component that integrates Straddle's services into your React applications. It provides a seamless way to embed the Straddle widget and handle events within your React components.

Readme

@straddleio/bridge-react

Overview

@straddleio/bridge-react is a React component that integrates Straddle's services into your React applications. It provides a seamless way to embed the Straddle widget and handle events within your React components.

Installation

Install the package using npm:

npm install @straddleio/bridge-react

Or using yarn:

yarn add @straddleio/bridge-react

Usage

Here's an example of how to use @straddleio/bridge-react in your application:

import React, { useState } from 'react'
import { StraddleBridge } from '@straddleio/bridge-react'

const StraddleBridgeController = () => {
    const [open, setOpen] = useState(true)
    const token = 'your-authentication-token' // replace with your token
    const mode = 'sandbox' // 'production' or 'sandbox'

    const handleSuccess = (data: TPaykeyResponse) => {
        console.log('Success event, paykey data is:', data)
    }

    const handleSuccessCTAClicked = () => {
        console.log('Success CTA clicked (after a success, when the user clicks the CTA button)')
        setOpen(false)
    }

    const handleClose = () => {
        console.log('Straddle widget closed')
    }

    const handleLoadError = (error: any) => {
        console.error('Error loading Straddle Bridge Widget', error)
    }

    return (
        <div>
            <button onClick={() => setOpen(true)}>Open Straddle Widget</button>
            {open && (
                <StraddleBridge
                    mode={mode}
                    token={token}
                    onSuccess={handleSuccess}
                    onSuccessCTAClicked={handleSuccessCTAClicked}
                    onClose={handleClose}
                    onLoadError={handleLoadError}
                    style={{
                        position: 'fixed',
                        width: '100%',
                        height: '100%',
                        top: 0,
                        left: 0,
                        zIndex: 2147483647,
                    }}
                />
            )}
        </div>
    )
}

export default StraddleBridgeController

Props

  • token: (Required) Authentication token obtained from Straddle's API.
  • onSuccess: (Required) Callback function invoked when the operation is successful. This is how you can access the Paykey.
  • mode: (Required) Possible values: production, sandbox.
  • open: (Optional) Boolean indicating whether the Straddle widget should be displayed.
  • onSuccessCTAClicked: (Optional) Callback function invoked when the CTA (Call to Action) button is clicked.
  • onClose: (Optional) Callback function invoked when the Straddle widget is closed.
  • onLoadError: (Optional) Callback function invoked when there's an error loading the Straddle iframe.
  • onManualEntry: (Optional) Callback function invoked when the user clicks the manual entry button.
  • onRetry: (Optional) Callback function invoked when the user clicks the retry button.
  • ref: (Optional) Ref to attach the iframe to a specific DOM element. If not passed, the iframe will be appended to the body.
  • style: (Optional) Custom styles for the iframe containing the Straddle widget. If passed, it should be an object with CSS properties, and will replace any default style. If not passed, the widget will fill the whole screen.
  • className: (Optional) Custom class names for styling the iframe. This will not replace the default styling, if you want no style to be applied you must pass an empty object as style.

API Reference

For detailed API documentation, please refer to the Straddle API Documentation.

License

This project is licensed under the MIT License.