open-index/open-npm huggingface dataset:
npm package: @korioinc/next-core
Description: Core utilities and components for Next.js applications.
Author: Korio Inc.
Latest version: 2.0.35

# @korioinc/next-core

Core utilities and components for Next.js applications.

## Installation

```bash
pnpm add @korioinc/next-core
```

## Features

- **Authentication**: Complete auth system with JWT support
- **Internationalization**: i18n routing and locale management
- **Components**: Reusable UI components (Theme switcher, Locale switcher)
- **Ads Management**: Ad container components and configurations
- **API Client**: Configured fetch client with interceptors
- **Navigation**: Type-safe navigation system
- **Local Storage**: Enhanced local storage management
- **Utilities**: Common utility functions

## Usage

### Authentication

```typescript
import { useAuthContext } from '@korioinc/next-core/auth/client';
import { getCurrentUser } from '@korioinc/next-core/auth/server';

// Client-side
const { isLogin, user, login, logout } = useAuthContext();

// Server-side
const user = await getCurrentUser();
```

### Internationalization

```typescript
import { handleLocaleRouting } from '@korioinc/next-core/i18n/routing';

// In middleware.ts
export default function middleware(request: NextRequest) {
  return handleLocaleRouting(request);
}
```

### Components

```typescript
import { ThemeSwitcher, LocaleSwitcher } from '@korioinc/next-core/components';
import { ThemeProvider } from '@korioinc/next-core/theme/server';

export function Layout({ children }: { children: React.ReactNode }) {
  return (
    <ThemeProvider attribute="class" enableSystem defaultTheme="system">
      {children}
    </ThemeProvider>
  );
}

export function Header() {
  return (
    <header>
      <ThemeSwitcher />
      <LocaleSwitcher />
    </header>
  );
}
```

### Ads

```typescript
import { AdContainer } from '@korioinc/next-core/ads';

export function Page() {
  return (
    <AdContainer
      adType="leaderboard"
      className="my-4"
    />
  );
}
```

## Requirements

- Next.js 15+
- React 19+
- TypeScript 5.9+

## License

MIT

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.