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

@sherrylinks/slinks

v0.11.33-beta

Published

[![npm version](https://badge.fury.io/js/%40sherrylinks%2Fslinks.svg)](https://badge.fury.io/js/%40sherrylinks%2Fslinks)

Readme

@sherrylinks/slinks

npm version

React components, hooks, adapters, and utilities for integrating SherryLinks Triggers into web applications and browser extensions.

Overview

Slinks provides the tools to easily embed SherryLinks functionality. It allows you to:

  • Render Triggers based on metadata using the Trigger.
  • Integrate with EVM wallets using Wagmi via the useWagmiAdapter.
  • Use a dedicated adapter (SherryExtensionAdapter) for browser extension environments.
  • Detect and process SherryLinks URLs found on web pages.
  • Observe platforms like Twitter/X to automatically enhance links with Trigger previews or buttons (twitterObserverEVM).

Installation

npm install @sherrylinks/slinks @sherrylinks/slinks-core wagmi viem @tanstack/react-query react react-dom
# or
yarn add @sherrylinks/slinks @sherrylinks/slinks-core wagmi viem @tanstack/react-query react react-dom
# or
pnpm add @sherrylinks/slinks @sherrylinks/slinks-core wagmi viem @tanstack/react-query react react-dom

Note: @sherrylinks/slinks-core, react, react-dom, wagmi, viem, and @tanstack/react-query are peer dependencies.

Basic Usage (React App)

  1. Import CSS: Import the necessary styles in your main application file.

    // e.g., in src/main.tsx or src/App.tsx
    import '@sherrylinks/slinks/index.css';
  2. Set up Wagmi: Ensure your application is wrapped with WagmiProvider and QueryClientProvider.

  3. Use the Adapter and Component:

    import { Trigger, useWagmiAdapter } from '@sherrylinks/slinks';
    import { createMetadata, ValidatedMetadata } from '@sherrylinks/sdk'; // Assuming SDK provides validation
    import '@sherrylinks/slinks/index.css'; // Don't forget the CSS!
    
    // Your Trigger Metadata (fetch or define it)
    const rawMetadata = { /* ... your metadata object ... */ };
    
    function MyComponent() {
      const adapter = useWagmiAdapter(); // Hook to get wallet interaction functions
    
      // Validate metadata (example using a hypothetical SDK function)
      let validatedMetadata: ValidatedMetadata | undefined;
      try {
        validatedMetadata = createMetadata(rawMetadata);
      } catch (error) {
        console.error("Invalid Metadata:", error);
        // Handle invalid metadata case
      }
    
      if (!validatedMetadata) {
        return <div>Error loading Trigger metadata.</div>;
      }
    
      return (
        <div>
          <h1>My App with Slinks</h1>
          <Trigger
            metadata={validatedMetadata}
            adapter={adapter}
            // securityState can be 'trusted', 'unknown', 'malicious' based on directory lookup
            securityState="trusted"
          />
        </div>
      );
    }
    
    export default MyComponent;

Key Features & Exports

  • Components:
    • Trigger: Renders the main Trigger UI based on metadata.
    • WalletButton: A simple button component for wallet connection flows.
    • SlinksPreview: (If exported) A component to show a preview based on a URL.
  • Hooks:
    • useWagmiAdapter: Provides a SherryAdapter instance integrated with Wagmi for wallet interactions (connect, sign, send transaction, etc.).
  • Adapters:
    • SherryAdapter: Interface defining the required wallet interaction methods.
    • SherryExtensionAdapter: An adapter specifically designed for use within browser extensions, communicating via chrome.runtime.sendMessage.
  • Utilities:
    • detectSherryUrl: Checks if a URL is potentially a SherryLink.
    • fetchSlinksMetadata: Fetches metadata from a given URL.
    • sanitizeText, processUrlWithAction: URL processing helpers.
  • Extension Integration:
    • setupTwitterObserverEVM: Initializes an observer for Twitter/X to find and enhance links.
    • handleNewNode: Function called by the observer when a potential link node is found.

Browser Environment & Polyfills

This library aims to work in modern browser environments, including browser extensions. It uses tsup for bundling and includes necessary polyfills (like Buffer) for browser compatibility. See CONTRIBUTING.md for more details on the build process and polyfill strategy if you encounter issues.

License

MIT