open-index/open-npm huggingface dataset:
npm package: @pulsebear/events
Description: PulseBear events SDK for the web (React provider & core)
Latest version: 0.0.1

# @pulsebear/events

Type-safe web events SDK with a tiny React provider and hook.

## Install

This package is part of a monorepo. In your app add the dependency and build the package.

## Usage

```tsx
import { PulseBearProvider, usePulseBear } from "@pulsebear/events";

function AppProviders({ children }: { children: React.ReactNode }) {
  return (
    <PulseBearProvider
      config={{
        apiUrl: "/api/events", // default
        appKey: process.env.NEXT_PUBLIC_PULSEBEAR_KEY,
      }}
    >
      {children}
    </PulseBearProvider>
  );
}

function CheckoutButton() {
  const { track } = usePulseBear();
  return (
    <button
      onClick={() =>
        track("checkout", {
          action: "Payment successful",
          description: "2x 1TB SSD - Overnight Shipping",
          fields: { quantity: 2, shipping: "overnight", success: true },
        })
      }
    >
      Buy
    </button>
  );
}
```

## Strongly typed categories (optional)

```tsx
// categories.ts
export const CATEGORIES = ["auth", "checkout", "bug"] as const;
export type Category = (typeof CATEGORIES)[number];

// app
import type { Category } from "./categories";
import { PulseBearProvider, usePulseBear } from "@pulsebear/events";

function Component() {
  const { track } = usePulseBear<Category>();
  //      ^ track enforces Category union
  // track("unknown" ...) // type error
}
```

## API

- PulseBearProvider: wraps your app; accepts `{ apiUrl?, appKey?, defaultCategory? }`.
- usePulseBear: returns `{ track, config }`.
- track(category, { action, description?, fields? }) → Promise<void>.

## Framework agnostic core

`sendEvent()` in `core` can be used in non-React environments. Future packages can wrap it for Vue/Svelte.

## License

MIT
npm package: @pulsebear/speed-insights
Description: Universal Speed Insights SDK for PulseBear
Latest version: 0.1.0

# @pulsebear/speed-insights

Enterprise-ready, lightweight Web Vitals SDK for PulseBear.

## Features

- Safe in SSR/Edge environments (no-ops outside the browser)
- sendBeacon-first with fetch fallback
- Optional batching with flush on pagehide/visibilitychange/offline→online
- Sampling (0..1) to control volume
- Context provider to attach custom metadata (PII-free)
- Device + network attribution (effectiveType, rtt, DPR, etc.)
- Tiny core, optional React component entry `@pulsebear/speed-insights/react`
- TypeScript types and ESM/CJS builds

## Install

```bash
pnpm add @pulsebear/speed-insights
```

## Usage (vanilla)

```ts
import {
  initPulseBearVitals,
  reportCustomMetric,
  setContextProvider,
} from "@pulsebear/speed-insights";

setContextProvider(() => ({
  env: process.env.NODE_ENV,
}));

initPulseBearVitals({
  projectId: "YOUR_PROJECT_ID",
  sampling: 1,
  batch: { enabled: true, size: 20, intervalMs: 5000 },
});

// Optional custom metric
reportCustomMetric("hero_visible_ms", 123);
```

## Usage (React)

```tsx
import SpeedInsights from "@pulsebear/speed-insights/react";

export default function App() {
  return (
    <>
      {/* your app */}
      <SpeedInsights projectId="YOUR_PROJECT_ID" batch={{ enabled: true }} />
    </>
  );
}
```

## Usage (Astro)

```astro
---
import { setupSpeedInsights } from "@pulsebear/speed-insights/astro";
---
<script>
  setupSpeedInsights({ projectId: "YOUR_PROJECT_ID" });
  // Optional: setContextProvider(() => ({ env: import.meta.env.MODE }))
</script>
```

## Usage (SvelteKit)

```svelte
<script lang="ts">
  import { onMount } from "svelte";
  import { setupSpeedInsights } from "@pulsebear/speed-insights/sveltekit";
  onMount(() => {
    setupSpeedInsights({ projectId: "YOUR_PROJECT_ID" });
  });
</script>
```

## API

- `initPulseBearVitals(options)` – starts web-vitals listeners
- `reportCustomMetric(name, value?, attributes?)`
- `setContextProvider(fn)` – adds metadata to each event
- `flush()` – force send queued events
- `isInitialized()` – check if SDK initialized on this page

### Options

```ts
interface InitOptions {
  endpoint?: string; // default: https://www.pulsebear.com/api/vitals
  projectId: string; // required
  sampling?: number; // 0..1, default 1
  headers?: Record<string, string>;
  batch?: {
    enabled?: boolean; // default false
    size?: number; // default 20
    intervalMs?: number; // default 5000
    endpoint?: string; // defaults to `${endpoint}/batch`
  };
  getContext?: () => Record<string, unknown>;
  debug?: boolean; // default false
  vitals?: {
    reportAllChanges?: boolean;
  };
}
```

## Notes

- The SDK avoids sending data when offline and retries on the next flush.
- Keep context small to minimize payload size. Avoid PII.
- If batching is disabled, events are sent individually as they arrive.
npm package: @pulseboard/react-native
Description: Official PulseBoard SDK for React Native
Author: Arslan Mushtaq
Latest version: 1.0.0

# @pulseboard/react-native

> Official React Native SDK for PulseBoard — mobile app observability platform
> by [Aenexar](https://github.com/aenexar).

## Installation

```bash
npm install @pulseboard/react-native
```

### iOS

```bash
npx pod-install
```

### Android

No additional steps required — autolinking handles it.

## Quick Start

```typescript
import { PulseBoard } from "@pulseboard/react-native";

// Initialise once at app entry point
PulseBoard.init({
  host: "https://your-backend-url.com",
  apiKey: "your-project-api-key",
  app: {
    version: "1.0.0",
    buildNumber: "1",
    environment: "production",
  },
  debug: false,
  autoCapture: true,
  flushInterval: 5000,
  maxQueueSize: 100,
});
```

## API Reference

### Initialisation

```typescript
PulseBoard.init(config: SDKConfig): void
```

### User

```typescript
PulseBoard.identify(user: UserContext): void
PulseBoard.clearUser(): void
```

### Events

```typescript
PulseBoard.track(name: string, options?: TrackOptions): void
PulseBoard.metric(name: string, value: number, options?: TrackOptions): void
PulseBoard.captureError(error: Error, options?: CaptureErrorOptions): void
```

### Analytics

```typescript
PulseBoard.startSession(): void
PulseBoard.endSession(duration?: number): void
PulseBoard.trackScreen(screenName: string, loadTime?: number): void
PulseBoard.trackApiCall(
  endpoint:     string,
  httpMethod:   string,
  statusCode:   number,
  duration:     number,
  payloadSize?: number,
): void
PulseBoard.trackCrash(error: Error, isFatal?: boolean): void
```

### Utilities

```typescript
PulseBoard.getContext(): Promise<EnrichedContext>
PulseBoard.flush(): Promise<void>
PulseBoard.destroy(): void
```

### Components & Hooks

```typescript
// Error boundary — wraps your app to catch render errors
<PulseBoardErrorBoundary>
  <App />
</PulseBoardErrorBoundary>

// Hook — screen tracking and event helpers
const { trackScreen, track } = usePulseBoard()
```

## Platform Support

| Platform     | Minimum Version |
| ------------ | --------------- |
| iOS          | 13.0+           |
| Android      | API 21+         |
| React Native | 0.73+           |

## Example App

See [pulseboard-example-rn-cli](https://github.com/aenexar/pulseboard-example-rn-cli)
for a full working example.

## License

Private — © 2026 Aenexar. All rights reserved.
npm package: @pulsechain/msgboard
Description: Do work for and interact with the msgboard module
Author: PulseChain
Latest version: 0.0.28

# @pulsechain/msgboard

distribute messages across networks using Proof of Work as the gate.

## setup

```sh
npm i --save @pulsechain/msgboard
```

## usage

using viem

```ts
import * as msgboard from '@pulsechain/msgboard'
import { createPublicClient, http } from 'viem'
import { pulsechainV4 } from 'viem/chains'
// create a public client for connecting to a node
const client = createPublicClient({
  transport: http(),
  chain: pulsechainV4,
})
// create the msgboard client
const board = new msgboard.MsgBoardClient(msgboard.wrap1193(client))
// do the work for your given category and data
const work = await board.doPoW('category', 'data')
// send valid work to the network
const hash = board.addMessage(work)
```

using ethers

```ts
import * as msgboard from '@pulsechain/msgboard'
import { providers } from 'ethers'
import { pulsechainV4 } from 'viem/chains'
// create a public client for connecting to a node
const client = new providers.JsonRpcProvider('https://my-msgboard-rpc.io')
// create the msgboard client
const board = new msgboard.MsgBoardClient(client)
// do the work for your given category and data
const work = await board.doPoW('category', 'data')
// send valid work to the network
const hash = board.addMessage(work)
```

## understanding difficulty

difficulty can be computed by passing an encoded hex string to the `getDifficulty` method

```ts
board.getDifficulty('0x') // 167_772n
```

or by looking at the the `difficulty` utility found in `@pulsechain/msgboard/utils`

```ts
((2n ** 24n + BigInt(dataLen) * 10_000n) * workMultiplier) / workDivisor
```

The length of data is measured using bytes instead of hex characters. Each byte adds 10_000 increase in difficulty with the default settings. This is anticipated to encourage efficient message packing strategies while not completely out running the difficulty needed to send on the network.

## blocking

because javascript blocks during proof of work checks, putting the work under a process separate from your UI render is worth consideration.

## future features

- [ ] update block by event rather than timeout
npm package: @pulsechainorg/gas-estimation
Description: The fork of MyCrypto EIP 1559 gas estimation strategy for PulseChain.
Author: PulseChain team
Latest version: 1.1.7

# gas-estimation

EIP-1559 gas estimation library, using the estimation strategy of MyCrypto. The library does not depend on a third-party
API but rather fetches the historic data (for the latest 10 blocks) from a regular Ethereum node directly.

## Getting Started

The library is published on npm. To install it, you can use `npm` or `yarn`:

```text
yarn add @pulsechainorg/gas-estimation
```

or

```text
npm install @pulsechainorg/gas-estimation
```

### Example

```ts
import { estimateFees } from '@pulsechainorg/gas-estimation';

// Estimation using a JSON-RPC endpoint.
// Web3.js, Ethers.js and EIP-1193 providers are also supported, see the documentation.
const { maxFeePerGas, maxPriorityFeePerGas } = await estimateFees('http://127.0.0.1:8545');

console.log(maxFeePerGas, maxPriorityFeePerGas);
```

## API

The library exposes a function to estimate gas fees based on the latest 10 blocks, and the underlying function used to calculate the estimate.

### `estimateFees(provider)`

- `provider` - A Web3 instance, Ethers.js provider, JSON-RPC endpoint, or EIP-1193 compatible provider.
- Returns: \<Promise\<EstimationResult\>\> - An object containing the estimated `maxFeePerGas`, `maxPriorityFeePerGas`, and `baseFee`, as `bigint` (all values in Wei).

### `calculateFees(baseFee, feeHistory)`

- `baseFee` - The current base fee as a `bigint` (in Wei).
- `feeHistory` - The fee history object returned by a node when calling `eth_feeHistory`.
- Returns: \<EstimationResult\> - An object containing the estimated `maxFeePerGas`, `maxPriorityFeePerGas`, and `baseFee`, as `bigint` (all values in Wei).

### Providers

Currently, gas-estimation has support for four different providers:

- Ethers.js, by using an existing Ethers.js provider.
- Web3, by using an instance of the Web3 class.
- HTTP, by using a URL of a JSON-RPC endpoint as string.
- EIP-1193 compatible provider, like `window.ethereum`.

## Contributing

If you found a bug, have a suggestion or want to contribute in any other way, feel free to open an issue or submit a pull request. Any contributions are highly appreciated.

## Compatibility

`gas-estimation` uses ES6+ functionality, which may not be supported on all platforms. If you need compatibility with older browsers or Node.js versions, you can use something like [Babel](https://github.com/babel/babel).

There is an ES compatible version available, which should work with module bundlers like [Webpack](https://webpack.js.org/) and [Rollup](https://github.com/rollup/rollup).
npm package: @pulsecharterconnect/types
Description: A TypeScript library for enhanced type safety.
Author: Chris Tyler
Latest version: 0.2.124

# Pulse Charter Connect Typescript Library

This is a TypeScript library that provides various types and interfaces to enhance type safety in the Pulse Charter Connect Application across the frontend and backend

## Installation

You can install the library via npm:

```
npm install @pulsecharterconnect/types
```

## Usage

To use the types and interfaces provided by this library, you can import them into your TypeScript files:

```typescript
import { ApiResult } from '@pulsecharterconnect/types';
```

## API Reference

### Types

- **ApiResult**: Used to respond to an HTTP request.