open-index/open-npm huggingface dataset:
npm package: @ogcio/nextjs-analytics
Description: The `@ogcio/nextjs-analytics` package provides a set of utilities and components to integrate analytics tracking into Next.js applications. It leverages the `@ogcio/analytics-sdk` to track events, page views, and manage analytics configurations.
Latest version: 1.0.1

# Next.js Analytics

The `@ogcio/nextjs-analytics` package provides a set of utilities and components to integrate analytics tracking into Next.js applications. It leverages the `@ogcio/analytics-sdk` to track events, page views, and manage analytics configurations.

## Features

- **AnalyticsProvider**: A React context provider to initialize and manage the analytics instance.
- **useAnalytics Hook**: A custom hook to interact with the analytics instance for tracking events and page views.
- **TypeScript Support**: Fully typed for better developer experience.

## Installation

Install the package using npm or yarn:

```bash
npm install @ogcio/nextjs-analytics
# or
yarn add @ogcio/nextjs-analytics
```

## Usage

### AnalyticsProvider

Wrap your application with the `AnalyticsProvider` to initialize the analytics instance:

```tsx
import { AnalyticsProvider } from "@ogcio/nextjs-analytics";

const analyticsConfig = {
  baseUrl: "https://analytics.example.com",
  trackingWebsiteId: "your-website-id",
  organizationId: "your-organization-id",
  dryRun: false, // Set to true for testing without sending data
};

function MyApp({ children }: { children: React.ReactNode }) {
  return (
    <AnalyticsProvider config={analyticsConfig}>
      {children}
    </AnalyticsProvider>
  );
}

export default MyApp;
```

### useAnalytics Hook

Use the `useAnalytics` hook to track events and page views:

```tsx
import { useAnalytics } from "@ogcio/nextjs-analytics";

function MyComponent() {
  const analyticsClient = useAnalytics();

  const handleClick = () => {
    analyticsClient.trackEvent({
      event: {
        category: "button",
        action: "click",
        name: "my-button",
      },
    });
  };

  useEffect(() => {
    analyticsClient.pageView({
      event: {
        title: "My Page",
      },
    });
  }, []);

  return <button onClick={handleClick}>Click Me</button>;
}
```

## Testing

This package includes unit tests for all utilities and components. To run the tests, use:

```bash
npm test
```
npm package: @ogcloud/setup
Description: Interactive CLI to generate config, deploy, update, and destroy OgCloud on Kubernetes using Helm
Latest version: 0.1.7

# @ogcloud/setup

`@ogcloud/setup` is an interactive deployment CLI for OgCloud.

It helps users deploy and manage OgCloud on Kubernetes with minimal prerequisites and without cloning Helm charts manually.

Project repository: https://github.com/Jevzo/ogcloud

Support Discord: [OgCloud | Support and Development](https://discord.gg/pE9gCBm822)

What it does:

- checks required tools (`kubectl`, `helm`, `npm`, `npx`)
- confirms active Kubernetes context before any operation
- downloads OgCloud Helm charts directly from GitHub (no `git` required)
- generates per-network values files with guided prompts
- deploys infra/platform/dashboard charts
- updates individual component image tags (`api`, `controller`, `loadbalancer`, `dashboard`)
- destroys an OgCloud deployment cleanly

## Prerequisites

- Kubernetes cluster access (`kubectl` configured)
- Helm 3+
- Node.js 18+ (`npm` / `npx`)

## Usage

```bash
npx @ogcloud/setup
npx @ogcloud/setup ogwars
npx @ogcloud/setup --generate-config ogwars
npx @ogcloud/setup --deploy ogwars
npx @ogcloud/setup --deploy ogwars --without-backing
npx @ogcloud/setup --update ogwars api 0.1.1
npx @ogcloud/setup --destroy ogwars
```

## Commands

- `--generate-config <network>`: creates/updates Helm override files and saved network state
- `--deploy <network>`: clean install; fails if target namespace already exists
- `--deploy <network> --without-backing`: skips infra chart and deploys platform/dashboard only
- `--update <network> <component> <tag>`: updates one component image tag and reapplies chart
- `--destroy <network>`: uninstalls releases and deletes namespace

## Local Files

Generated state and values are stored under:

- `~/.ogcloud-setup/state.json`
- `~/.ogcloud-setup/networks/<network>/values.infra.yaml`
- `~/.ogcloud-setup/networks/<network>/values.platform.yaml`
- `~/.ogcloud-setup/networks/<network>/values.dashboard.yaml`

Cached Helm chart source:

- `~/.ogcloud-setup/cache/Jevzo-ogcloud-main/helm`

## Notes

- On local clusters (for example Minikube), `LoadBalancer` services may require `minikube tunnel` for external IP assignment.
- `--without-backing` prompts for external MongoDB/Redis/MinIO/Kafka settings and still generates the platform/dashboard values files for you.

## Development

```bash
npm install
npm run build
npm run typecheck
node dist/setup.js --help
```