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

@anonfly/next

v1.0.4

Published

Anonfly Next.js Proxy Wrapper for secure API interactions

Downloads

426

Readme

@anonfly/next

Next.js Proxy Wrapper for secure, server-side Anonfly integration.

Features

  • Secure API Proxy: Hidden API keys from client-side code.
  • Server-Side Client: Specialized NextAnonflyClient that pulls from environment variables.
  • App Router Support: Easy integration with Next.js App Router API Routes.

Installation

npm install @anonfly/sdk @anonfly/next

Usage

1. Configure Environment Variables

Add your API key to your .env.local file:

ANONFLY_API_KEY=your_api_key_here

2. Create the API Proxy (App Router)

Create a file at app/api/anonfly/[...path]/route.ts:

import { createAnonflyProxy } from '@anonfly/next';

export const GET = createAnonflyProxy();
export const POST = createAnonflyProxy();
export const PATCH = createAnonflyProxy();
export const DELETE = createAnonflyProxy();

3. Use the Proxy in the Frontend

Now you can point your SDK or fetch calls to your local proxy instead of the global Anonfly API:

import { Anonfly } from '@anonfly/sdk';

const client = new Anonfly({
  apiKey: 'proxy', // API key not needed on frontend when using proxy
  baseUrl: '/api/anonfly'
});

4. Server-Side Usage

Use NextAnonflyClient in Server Actions or Route Handlers:

import { NextAnonflyClient } from '@anonfly/next';

export async function createRoomAction(name: string) {
  const client = new NextAnonflyClient(); // Automatically uses ANONFLY_API_KEY
  return await client.rooms.create({ roomname: name });
}

Security Note

Always use the proxy for client-side interactions to prevent API key exposure. The NextAnonflyClient should only be used in server-side environments (Server Actions, getStaticProps, getServerSideProps, Route Handlers).