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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cyberlas-auth

v1.0.7

Published

Authentication package for Cyberlas with Cloudflare Turnstile CAPTCHA

Downloads

6

Readme

Cyberlas Frontend

Next.js frontend components and pages for Cyberlas project.

Installation

npm install cyberlas-frontend

// app/layout.tsx
import { AuthProvider, QueryProvider, ToastProvider, Header } from 'cyberlas-frontend';
import 'bootstrap/dist/css/bootstrap.min.css';
import './globals.css';

export default function RootLayout({ children }) {
  return (
    <html lang="ru">
      <body>
        <QueryProvider>
          <AuthProvider>
            <ToastProvider>
              <Header />
              <main>
                {children}
              </main>
            </ToastProvider>
          </AuthProvider>
        </QueryProvider>
      </body>
    </html>
  );
}

// app/login/page.tsx
import { Login } from 'cyberlas-frontend';

export default function LoginPage() {
  return <Login />;
}

// app/register/page.tsx
import { Register } from 'cyberlas-frontend';

export default function RegisterPage() {
  return <Register />;
}

// app/admin/page.tsx
import { AdminDashboard } from 'cyberlas-frontend';

export default function AdminPage() {
  return <AdminDashboard />;
}

// app/dashboard/page.tsx
import { DashboardPage } from 'cyberlas-frontend';

export default function Dashboard() {
  return <DashboardPage />;
}

import { Login } from 'cyberlas-frontend';

<Login />

import { Register } from 'cyberlas-frontend';

<Register />

AdminDashboard

Complete admin panel with user management, statistics, and filtering.

Features:

    User statistics cards

    User management table

    Role and status management

    Advanced filtering and search

    Real-time data updates

    import { AdminDashboard } from 'cyberlas-frontend';

<AdminDashboard />

DashboardPage

User dashboard with personal information and quick actions.

import { DashboardPage } from 'cyberlas-frontend';

<DashboardPage />

Layout Components
Header

Navigation header with authentication state, user menu, and role-based links.

import { Header } from 'cyberlas-frontend';

<Header />

UI Components
AnimatedButton

Button with hover and tap animations.

import { AnimatedButton } from 'cyberlas-frontend';

<AnimatedButton
  variant="primary"
  isLoading={false}
  onClick={() => console.log('Clicked')}
>
  Click Me
</AnimatedButton>

AnimatedCard

Card component with entrance and hover animations.

import { AnimatedCard } from 'cyberlas-frontend';

<AnimatedCard className="custom-class">
  <h5>Card Title</h5>
  <p>Card content</p>
</AnimatedCard>

Providers
AuthProvider

Authentication context provider with user management.

import { AuthProvider, useAuth } from 'cyberlas-frontend';

// In component
const { user, isLoading, isAdmin } = useAuth();

QueryProvider

React Query provider for server state management.
ToastProvider

Toast notifications system.

import { useToast } from 'cyberlas-frontend';

const toast = useToast();
toast.success('Operation completed!');
toast.error('Something went wrong');

Hooks
useAuth

Authentication state management.

import { useAuth } from 'cyberlas-frontend';

const {
  user,           // Current user object
  isLoading,      // Loading state
  isAdmin,        // Admin check
  logout          // Logout function
} = useAuth();

useForm

Form handling with validation using react-hook-form and Zod.

import { useForm, loginSchema } from 'cyberlas-frontend';

const form = useForm({
  schema: loginSchema,
  defaultValues: { email: '', password: '' }
});

// In component
<form onSubmit={form.handleSubmit((data) => console.log(data))}>
  <input {...form.register('email')} />
  {form.formState.errors.email && <span>{form.formState.errors.email.message}</span>}
</form>

Admin Hooks

import {
  useUsersStats,
  useUsers,
  useUpdateUser,
  useDeleteUser
} from 'cyberlas-frontend';

// User statistics
const { data: stats, isLoading: statsLoading } = useUsersStats();

// User list with filtering
const { data: users, isLoading: usersLoading } = useUsers({
  page: 1,
  role: 'super_admin',
  search: 'john'
});

// User mutations
const updateUser = useUpdateUser();
const deleteUser = useDeleteUser();

API & Utilities
API Clients

import { authApi, adminApi } from 'cyberlas-frontend';

// Authentication
await authApi.login({ email, password });
await authApi.register({ name, email, password });
await authApi.logout();

// Admin operations
await adminApi.getUsers({ page: 1, role: 'super_admin' });
await adminApi.updateUser(userId, { name: 'New Name' });

Validation Schemas
tsx

import { loginSchema, registerSchema } from 'cyberlas-frontend';

// Use with useForm hook
const form = useForm({ schema: loginSchema });

Types
tsx

import {
  User,
  LoginData,
  RegisterData,
  UserStats
} from 'cyberlas-frontend';

Development
Building the Package
bash

npm run build-package

Testing Locally
bash

npm pack
# Then install in your project
npm install ../path/to/cyberlas-frontend-1.0.0.tgz

Project Structure
text

cyberlas-frontend/
├── app/                 # Page components
│   ├── admin/page.tsx
│   ├── dashboard/page.tsx
│   ├── login/page.tsx
│   └── register/page.tsx
├── components/          # Reusable components
│   ├── layout/
│   └── ui/
├── lib/                # Utilities and hooks
│   ├── api/
│   ├── hooks/
│   ├── types/
│   ├── utils/
│   └── validation/
└── index.ts           # Main exports

Dependencies

    Next.js 13+ - React framework

    React 18 - UI library

    TypeScript - Type safety

    React Bootstrap - UI components

    Framer Motion - Animations

    React Hook Form - Form handling

    Zod - Schema validation

    TanStack Query - Server state management

    Axios - HTTP client

License

MIT License - see LICENSE file for details.