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

@enfyra/sdk-next

v0.2.0

Published

Enfyra SDK for Next.js App Router — one-line config preset, providerless client hooks, request-scoped server client

Readme

@enfyra/sdk-next

Enfyra SDK for Next.js App Router. One-line config preset, providerless client hooks, request-scoped server client.

Quick Start

yarn add @enfyra/sdk-next

Set your Enfyra URL:

ENFYRA_APP_URL=http://localhost:3000

Replace your next.config.mjs with:

export { default } from '@enfyra/sdk-next'

That's it. No CLI, no generated routes, no middleware, no Provider.

Configured Preset

If you prefer config over env:

import enfyra from '@enfyra/sdk-next'

export default enfyra({
  appUrl: 'http://localhost:3000',
  routePrefix: '/api/enfyra',
})

Existing Config

Wrap your current config:

import { withEnfyra } from '@enfyra/sdk-next'

export default withEnfyra(nextConfig, {
  routePrefix: '/api/enfyra',
})

Works with object, sync function, and async function configs. Your existing rewrites, basePath, redirects and headers are preserved.

Client Hooks

'use client'

import { useAuth, useEnfyra, useQuery, useMutation, useStorage } from '@enfyra/sdk-next/client'

function Profile() {
  const { user, isAuthenticated, pending, login, logout } = useAuth()
  const client = useEnfyra()
}

No Provider needed. Hooks are SSR-safe — server render is always anonymous/idle, auth refresh starts after hydration.

Server Components

import { createServerEnfyra } from '@enfyra/sdk-next/server'

export default async function Page() {
  const client = await createServerEnfyra()
  const result = await client.from('posts').execute()
}

Creates a fresh request-scoped client per call, forwarding the current request's cookies.

Server Actions

'use server'

import { createServerActionEnfyra } from '@enfyra/sdk-next/server'

export async function loginAction(formData: FormData) {
  const { client, applySetCookies } = await createServerActionEnfyra()
  const response = await client.post('/auth/login', {
    email: formData.get('email'),
    password: formData.get('password'),
  })
  applySetCookies(response.headers['set-cookie'] ?? [])
}

Options

| Option | Default | Description | |--------|---------|-------------| | appUrl | ENFYRA_APP_URL env | Enfyra server origin URL | | routePrefix | /api/enfyra | Browser-facing proxy prefix | | realtime | false | Add Socket.IO rewrite rule |

Requirements

  • Next.js >=14 <17 (App Router only)
  • React >=18 <20
  • Node.js >=18.18

License

MIT