open-index/open-npm huggingface dataset:
npm package: @parafin/parafin-node
Description: A node.js client for the Parafin API
Latest version: 1.2.9
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# parafin-node [![Build](https://github.com/buildparafin/parafin-node/actions/workflows/build.yml/badge.svg)](https://github.com/buildparafin/parafin-node/actions/workflows/build.yml)

A node.js client library for the [Parafin API][2].

## Getting started

The module supports all Parafin API endpoints.  For complete information about the API, head
to the docs. All endpoints require a valid `client_id` and `secret` to access and are 
accessible from a valid instance of a Parafin client object:

```javascript
import * as parafin from './parafin'

const parafinClient = new parafin.Client({
  token: token,
  environment: parafin.environment.development,
})

// Example endpoint
parafinClient.partner().then((data: any) => console.log(data))
```

The `environment` parameter dictates which Parafin API environment you will access. Values are:
- `parafin.environment.production` - production use, makes requests on https://api.parafin.com
- `parafin.environment.development` - use for integration development and testing, makes requests on https://api.dev.parafin.com

## Methods

Once an instance of the client has been created you can use the following methods:
```javascript
// Receive a combined payload
parafinClient.data()

// Receive partner information
parafinClient.partner()

// Receive business information
parafinClient.businessCore()

// Receive offer collection information
parafinClient.offerCollection()

// Receive cash advance information
parafinClient.cashAdvance()

// Receive optIn information
parafinClient.optIn()

// OptInRequest object for posting an opt in
const accountManager: parafin.AccountManager {
  name: 'John Doe',
  email: 'jdoe@mygym.com'
}

const data: parafin.OptInRequest = {
  businessExternalId: 'externalId001',
  businessName: 'The Chiseled Jalapeño',
  ownerFirstName: 'John',
  ownerLastName: 'Doe',
  accountManagers: [
    accountManager
  ],
  routingNumber: '12345678',
  accountNumberLastFour: '0000',
  email: 'jdoe@mygym.com',
  postalCode: '12345'
}

// Post optIn information
parafinClient.postOptIn(data: OptInRequest)

// OptOutRequest object for posting an opt out
const data: parafin.OptOutRequest = {
  businessExternalId: string
}

// Post optOut information
parafinClient postOptOut(data: OptOutRequest)
```

## Install

```console
npm i parafin-node
```

## Build

```console
npm run build
```

## Lint

```console
npm run lint
```

## Local Run

```console
npx ts-node src/parafin.ts
```

## Support
Open an [issue][4]!

## License
[MIT][5]

[1]: https://parafin.com
[2]: https://docs.parafin.com
[3]: https://github.com/buildparafin/react-parafin-elements#readme
[4]: https://github.com/buildparafin/parafin-node/issues/new
[5]: https://github.com/buildparafin/parafin-node/blob/main/LICENSE
npm package: @parafin/react-parafin-elements
Description: React component for integrating with Parafin
Author: Parafin
Latest version: 2.5.7

# react-parafin-elements [![npm version](https://badge.fury.io/js/@parafin%2Freact-parafin-elements.svg)](https://badge.fury.io/js/@parafin%2Freact-parafin-elements)

React component for integrating with Parafin

![Parafin Elements](https://parafin-assets.s3.amazonaws.com/portal/parafin-portal.png)

### Install

With `npm`

```
npm install --save @parafin/react-parafin-elements
```

With `yarn`

```
yarn add @parafin/react-parafin-elements
```

## Documentation

Please refer to the [official Parafin docs](https://docs.parafin.com).

## Examples

### Using pre-built component

```tsx
import React, { useCallback } from 'react'
import { ParafinElements, ParafinBusinessDetails } from 'react-parafin-elements'

const App = () => {

  // generate your Parafin token here
  const token = getParafinToken(businessId)

  const onOptIn = useCallback(async (businessId: string) => {
    // generate your business details here
    const businessDetails: ParafinBusinessDetails = { ... }
    return businessDetails
  }, [])

  return (
    // only initialize Elements once you have fetched a token
    <ParafinElements
      token={token}
      environment="development | production"
      onOptIn={onOptIn}
      product="capital | card"
    />
  )
}

export default App
```
npm package: @paragondao/bagle-sdk
Description: SDK for the BAGLE (Brain-AI General Learning Encoder) API — encode any biosignal into 128 universal coefficients
Author: ParagonDAO
Latest version: 0.1.1

# @paragondao/bagle-sdk

SDK for the **BAGLE** (Brain-AI General Learning Encoder) API.

Encode any biosignal — breathing, EEG, accelerometer, heart rate, typing cadence, gait — into **128 universal coefficients** (512 bytes). The encoder is signal-agnostic: it only sees numbers.

## Install

```bash
npm install @paragondao/bagle-sdk
```

## Quick Start

```js
import { BagleClient } from '@paragondao/bagle-sdk';

const client = new BagleClient();

// Encode any time-series into 128 coefficients
const result = await client.encode([1.2, 3.4, 5.6, 7.8, /* ... */]);
console.log(result.encoding); // 128 numbers
console.log(result.dim);      // 128
console.log(result.latency_ms); // ~3ms

// Compare two encodings
const sim = await client.similarity(encodingA, encodingB);
console.log(sim.similarity); // 0.0 to 1.0
```

## Client-Side Encoding (Offline)

For encoding without hitting the API:

```js
import { gleEncodeSignal, cosineSimilarity } from '@paragondao/bagle-sdk';

// Any numeric array — accelerometer, heart rate, breathing, typing intervals
const coefficients = gleEncodeSignal([1.2, 3.4, 5.6, 7.8, /* ... */]);
console.log(coefficients.length); // 128

// Compare locally
const score = cosineSimilarity(coefficientsA, coefficientsB);
```

## API Reference

### `BagleClient`

```js
const client = new BagleClient({
  baseUrl: 'https://bagle-api.fly.dev', // default
  apiKey: 'your-key',                    // optional
  timeout: 10000,                        // ms, default
});
```

#### `client.encode(features, modality?)`
Encode a numeric array into 128 GLE coefficients.

#### `client.similarity(encodingA, encodingB)`
Cosine similarity between two 128-dim encodings. Returns `{ similarity, distance }`.

#### `client.health()`
Check API status and model availability.

### Client-Side Functions

#### `gleEncode(audioSamples, sampleRate?)`
Encode PCM audio (16kHz default) using 1-second windows with identity band extraction (20-1000Hz).

#### `gleEncodeSignal(samples, opts?)`
General-purpose encoder for any numeric time-series. Options: `windowSize`, `bandMin`, `bandMax`.

#### `cosineSimilarity(a, b)`
Compute cosine similarity between two coefficient vectors.

## What Can You Encode?

Every phone sensor produces a time-series. Every time-series can be GLE-encoded:

| Signal | Source | Example App |
|--------|--------|------------|
| Breathing audio | Phone mic | Crisis screening, stress detection |
| Heart rate | Camera PPG | Fitness, sleep quality |
| Accelerometer | Motion sensor | Gait analysis, fall detection |
| Gyroscope | Rotation sensor | Tremor detection, balance |
| Typing cadence | Keyboard | Cognitive load, fatigue |
| EEG | MUSE headband | Consciousness classification |
| Temperature | Sensor | Fever screening |
| Barometric pressure | Barometer | Altitude sickness |

The network doesn't care what signal produced the 128 numbers.

## License

MIT