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

@bedrock_org/passport

v2.0.0

Published

<!--toc:start---->

Readme

Bedrock passport integration example

A React library for integrating authentication and wallet connection functionality into your web application with support for both traditional authentication methods and Web3 wallet connections.

How to Install

npm i @bedrock_org/passport

How to integrate

  1. Set up your provider
import { BedrockPassportProvider } from "@bedrock_org/passport";

const App = () => {
  return (
    <BedrockPassportProvider baseUrl="..." authCallbackUrl="..." tenantId="...">
      {/* Your app */}
    </BedrockPassportProvider>
  );
};

Provider Props

| Prop | Type | Required | Default | Description | | ----------------- | ------ | -------- | --------------------------- | ---------------------------------------------- | | authCallbackUrl | string | Yes | - | URL to redirect after authentication | | baseUrl | string | Yes | - | Base URL for the Bedrock Passport API | | tenantId | string | No | - | Your tenant ID | | walletConnectId | string | No | "xxxxxxxxx" | WalletConnect project ID | | appName | string | No | "Bedrock Passport" | Application name for wallet connections | | appDescription | string | No | - | Application description for wallet connections | | appUrl | string | No | - | Application URL for wallet connections | | appIcon | string | No | - | Application icon URL for wallet connections | | subscriptionKey | string | No | "DEMO_BEDROCK_PASSPORT_KEY" | API subscription key |

  1. Create an auth callback handler
import { useEffect } from "react";
import { useBedrockPassport } from "@bedrock_org/passport";

function AuthCallback() {
  const { loginCallback } = useBedrockPassport();

  useEffect(() => {
    const handleAuth = async () => {
      const params = new URLSearchParams(window.location.search);
      const token = params.get("token");
      const refreshToken = params.get("refreshToken");

      if (token && refreshToken) {
        const success = await loginCallback(token, refreshToken);
        if (success) {
          window.location.href = "/"; // Redirect after successful login
        }
      }
    };

    handleAuth();
  }, [loginCallback]);

  return <div>Authenticating...</div>;
}
  1. Add the login panel to your app
import { useBedrockPassport, LoginPanel, Button } from "@bedrock_org/passport";
import "@bedrock_org/passport/dist/style.css";

...
<LoginPanel
        panelClass="..."
        buttonClass="..."
        logo="..."
        title=""
        logoAlt=""
        logoClass=""
        ...
/>

Login Panel Props

| Property | Type | Description | | --------------------------------- | --------------- | --------------------------------------------------------- | | Main Settings | | | | title | string | Optional string for the login panel title | | logo | string | Optional string for the logo URL | | logoAlt | string | Optional string for the logo alt text | | walletButtonText | string | Optional string for wallet connection button text | | separatorText | string | Optional string for the separator text (defaults to "or") | | authTitle | string | Optional string for the authentication section title | | Features | | | | features | FeatureConfig | Optional object to control enabled features | | Panel Styling | | | | panelClass | string | Optional string for overall panel CSS classes | | Header Section Styling | | | | headerClass | string | Optional string for header container CSS classes | | titleClass | string | Optional string for title text CSS classes | | logoClass | string | Optional string for logo image CSS classes | | Button Styling | | | | buttonClass | string | Optional string for general button CSS classes | | Separator Styling | | | | separatorClass | string | Optional string for separator line CSS classes | | separatorTextClass | string | Optional string for separator text CSS classes | | Authentication Method Styling | | | | authTitleClass | string | Optional string for authentication title CSS classes | | Provider Buttons Styling | | | | googleButtonClass | string | Optional string for Google button CSS classes | | appleButtonClass | string | Optional string for Apple button CSS classes | | emailButtonClass | string | Optional string for Email button CSS classes | | walletButtonClass | string | Optional string for wallet connection button CSS classes | | Form Elements Styling | | | | formClass | string | Optional string for form container CSS classes | | inputClass | string | Optional string for input field CSS classes | | errorClass | string | Optional string for error message CSS classes | | successClass | string | Optional string for success message CSS classes | | User Info Display Styling | | | | profileButtonClass | string | Optional string for profile button CSS classes | | logoutButtonClass | string | Optional string for logout button CSS classes | | linkRowClass | string | Optional string for link row container CSS classes | | walletRowClass | string | Optional string for wallet connection row CSS classes |

The library uses Tailwind CSS for styling. You can customize the appearance of components by passing appropriate class names to the component props.

Feature Options

| Property | Type | Default | Description | | ----------------------- | --------- | ------- | ---------------------------------------------- | | enableWalletConnect | boolean | true | Enable/disable wallet connection functionality | | enableEmailLogin | boolean | true | Enable/disable email-based authentication | | enableGoogleLogin | boolean | true | Enable/disable Google social login | | enableAppleLogin | boolean | true | Enable/disable Apple social login | | enableCurrencyDisplay | boolean | false | Enable/disable currency panel display | | showProfileButton | boolean | false | Control visibility of the profile button | | showLogoutButton | boolean | true | Control visibility of the logout button |

Hooks and Methods

const { user, isLoggedIn, signOut, loginCallback } = useBedrockPassport();

Example Integration

The library is still in development, more features will be added in the future.

example of using the user hook, check if user is logged in

const { isLoggedIn } = useBedrockPassport();