Registry / crm-productivity / littlefish-nft-auth-framework

littlefish-nft-auth-framework

JSON →
library1.0.1jsnpmunverified

An open-source NFT and wallet authentication framework specifically for Cardano blockchain applications. Current stable version is 1.0.1. It provides React components (WalletConnectButton, WalletConnectPage), a WalletProvider context, hooks (useWallet), and utility functions for connecting/disconnecting wallets, fetching assets, and decoding hex data. Designed for Next.js with client-side rendering. Key differentiators: tailored for Cardano ecosystem, supports multiple wallets, TypeScript types included, and offers both client and server functions.

npm install littlefish-nft-auth-framework
INSTALL
IMPORT
SIG · LITTLEFISH-NFT-AUT
L
littlefish-nft-auth-framework
crm-productivityjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WalletProvider
import { WalletProvider } from 'littlefish-nft-auth-framework/frontend'
import { WalletProvider } from 'littlefish-nft-auth-framework'
Client-side components must be imported from '/frontend' subpath. The root package export may not include them.
useWallet
import { useWallet } from 'littlefish-nft-auth-framework/frontend'
import { useWallet } from 'littlefish-nft-auth-framework'
Hook is part of the frontend module, not the root index.
WalletConnectButton
import { WalletConnectButton } from 'littlefish-nft-auth-framework/frontend'
import WalletConnectButton from 'littlefish-nft-auth-framework/frontend'
Named export, not default. Also ensure client-side usage with 'use client' directive.

Sets up WalletProvider with hydration-safe client wrapper and renders WalletConnectButton in Next.js app directory.

// app/providers.tsx "use client"; import { WalletProvider } from 'littlefish-nft-auth-framework/frontend'; export default function Providers({ children }: { children: React.ReactNode }) { return <WalletProvider>{children}</WalletProvider>; } // app/ClientProviders.tsx "use client"; import Providers from './Providers'; import { useEffect, useState } from 'react'; export default function ClientProviders({ children }: { children: React.ReactNode }) { const [hasMounted, setHasMounted] = useState(false); useEffect(() => { setHasMounted(true); }, []); if (!hasMounted) return null; return <Providers>{children}</Providers>; } // app/layout.tsx import ClientProviders from './ClientProviders'; export default function RootLayout({ children }: { children: React.ReactNode }) { return ( <html> <body><ClientProviders>{children}</ClientProviders></body> </html> ); } // app/page.tsx "use client"; import { WalletConnectButton } from 'littlefish-nft-auth-framework/frontend'; export default function Home() { return <WalletConnectButton />; }
Debug
Known issues
gotchaWalletProvider must be wrapped in a client-only boundary (ClientProviders) to avoid hydration mismatches in Next.js App Router.
fix
Create a ClientProviders component that mounts the WalletProvider only on the client side, as shown in the quickstart.
affects: >=1.0.0
gotchaAll UI components (WalletConnectButton, WalletConnectPage) and hooks (useWallet) must be imported from 'littlefish-nft-auth-framework/frontend', not the root package.
fix
Use import { Component } from 'littlefish-nft-auth-framework/frontend'.
affects: >=1.0.0
gotchaThe useWallet hook and related components rely on Cardano wallet browser extensions (e.g., Nami, Eternl). They will not work in non-browser environments.
fix
Only use in a browser context; ensure code is run client-side only.
affects: >=1.0.0
gotchaThe package does not include a default export; all exports are named.
fix
Use named imports as shown in the documentation.
affects: >=1.0.0
Errors
Common errors & fixes
Module not found: Can't resolve 'littlefish-nft-auth-framework'
Package not installed or import path incorrect.
fix
Run npm install littlefish-nft-auth-framework. Ensure imports use correct subpath: 'littlefish-nft-auth-framework/frontend' for frontend components.
Error: Hydration failed because the initial UI does not match what was rendered on the server.
WalletProvider renders on server (window not available) causing mismatch.
fix
Wrap WalletProvider in a client-only component as shown in quickstart (ClientProviders).
TypeError: Cannot read properties of undefined (reading 'enable' )
Cardano wallet extension not installed or not detected.
fix
Ensure a compatible Cardano wallet (e.g., Nami, Eternl) is installed and enabled in the browser.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
lucid-cardanooptionalUsed for Cardano blockchain interactions and wallet APIs
Agent activity
32 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
littlefish-nft-auth-framework — npm install littlefish-nft-auth-framework · libregistry