open-index/open-npm huggingface dataset:
npm package: @permaweb/asset-web-sdk
Description: This SDK is for Atomic Assets in the browser.
Author: Tom Wilson
Latest version: 0.0.4

# Asset-Web-SDK

This SDK is for Atomic Assets in the browser.

## Install

```
npm install @permaweb/asset-web-sdk
```

## Usage

### init

```js
import Arweave from 'arweave'
import { WarpFactory } from 'warp-contracts'
import SDK from '@permaweb/asset-web-sdk'

const arweave = Arweave.init({ host: 'arweave.net', port: 443, protocol: 'https' })
const sdk = SDK.init({ arweave, warp: WarpFactory.forMainnet() })
```


### getAsset

```js
const result = await sdk.getAsset('vCU8cXnxkkMupiACruf9ih2M4k_CWIEvGsozbY9jlzg')
console.log('result', result)
```

## Developer Information

### test

```sh
yarn test
```

### format

```sh
yarn fmt
```

### lint

```sh
yarn lint
```

### coverage

```sh
yarn coverage
```
npm package: @permaweb/beam
Description: A hyperbeam cli tool
Latest version: 0.0.1

# beam

A simple cURL clone built with JavaScript that uses the `@permaweb/aoconnect` package.

## Installation

```bash
# Clone the repository
git clone https://github.com/yourusername/beam.git
cd beam

# Install dependencies
npm install

# Install globally
npm install -g .
```

## Usage

```bash
beam [options] <url>
```

### Options

- `-X, --request <method>`: Request method to use (default: "GET")
- `-H, --header <header>`: Pass custom header(s) to server (can be used multiple times)
- `-d, --data <data>`: HTTP POST data
- `-o, --output <file>`: Write to file instead of stdout
- `-v, --verbose`: Make the operation more talkative
- `-f, --file <file>`: Read data from file
- `--raw`: Display raw response data
- `-h, --help`: Display help for command
- `-V, --version`: Output the version number

### Examples

```bash
# Simple GET request
beam https://example.com

# POST request with data
beam -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://example.com/api

# POST request with data from file
beam -X POST -H "Content-Type: application/json" -f data.json https://example.com/api

# Save response to file
beam https://example.com -o response.txt

# Verbose mode
beam -v https://example.com
```

## How it works

The `beam` CLI extracts headers from `-H` flags and data from `-d` flag, then uses the `@permaweb/aoconnect` package's `request` function to make HTTP requests. It organizes the URL, headers, and other parameters into tags that are compatible with the aoconnect API.

## License

MIT
npm package: @permaweb/hyperbeam-loader
Description: This module takes an `ao` Wasm `ArrayBuffer` and returns a `handle` function, that given `SmartWeaveContract` inputs, will produce a `result`.
Latest version: 0.0.3
Deprecated: This package has been moved. Please use @permaweb/ao-connect for future versions of this package.

# ao Wasm Loader

This module takes an `ao` Wasm `ArrayBuffer` and returns a `handle` function,
that given `SmartWeaveContract` inputs, will produce a `result`.

The handle function can be invoked just like any other `SmartWeaveContract`

## Usage

The `@permaweb/ao-loader` MUST receive an `ArrayBuffer` that contains the Wasm
to be invoked:

```js
import AoLoader from "@permaweb/ao-loader";

/* SmartWeave READ-ONLY Env Variables */
const SmartWeave = {
  transaction: {
    id: "1",
  },
};

// Create the handle function that executes the Wasm
const handle = AoLoader(wasmBinary);

// Now invoke the handle
const result = await handle({ balances: 1 }, {
  caller: "1",
  input: { function: "balance" },
}, SmartWeave);
```

### Using a File

You can use `fs` to a load a Wasm file from the local filesystem as a Node
`Buffer`. Since a Node `Buffer` implements `ArrayBuffer`, it can be passed
directly to the `AoLoader` directly!

> To get back a Node `Buffer`, make sure to **NOT** pass an `encoding` parameter
> to `readFile`

```js
import AoLoader from "@permaweb/ao-loader";
import fs from "fs";

async function main() {
  const wasmBinary = fs.readFileSync("contract.wasm");
  const handle = AoLoader(wasmBinary);
  const result = await handle(...);
}
```

### Using `fetch`

You can also use native `fetch` to retrieve the Wasm as an `ArrayBuffer`. This
is great if you're fetching a Wasm contract published on Arweave:

```js
import AoLoader from "@permaweb/ao-loader";

async function main() {
  const tx_id = '...'
  const wasmBinary = await fetch(`https://arweave.net/${tx_id}`)
    .then(res => res.arrayBuffer())
  const handle = AoLoader(wasmBinary);
  const result = await handle(...)
}
```
npm package: @permaweb/loco
Description: Develop and troubleshoot AO processes locally by loading a wasm module and interacting with it via a simple JS API.
Author: Tom Wilson
Latest version: 0.0.21

# AOS Local

Develop and troubleshoot AO processes locally by loading a wasm module and
interacting with it via a simple JS API.

## Requirements
- Node 20+ (ESM only)
- Always run with `--experimental-wasm-memory64` (or set `NODE_OPTIONS`)

## Install
```bash
npm i @permaweb/loco
# or
yarn add @permaweb/loco
```

## Quick Start
```js
import { aoslocal, SQLITE } from '@permaweb/loco'

async function main() {
  const aos = await aoslocal(SQLITE) // or omit for latest default
  await aos.src('./test/example.lua') // bundles local Lua requires automatically

  const evalRes = await aos.eval('Count = 1 + 1')
  const { Output } = await aos.send({ Action: 'Eval', Data: 'Count' })
  console.log(Output.data)
}

main()
```
Run with the memory flag (or export once):
```bash
NODE_OPTIONS="--experimental-wasm-memory64" node index.js
```

## API
- `aoslocal(aosmodule = LATEST, env?)` → Promise<AOS>
  - `aosmodule`: use `SQLITE`, `LLAMA`, `LATEST` or an Arweave TX id
  - `env`: `{ Process, Module }` defaults are provided for local dev
- `aos.src(srcFile, env?)` → loads Lua source; packs `require()` graph into one
- `aos.eval(expr, env?)` → AOS_Result for an Eval action
- `aos.send(message, env?)` → AOS_Result; any extra fields become Tags
- `aos.load(processId)` → loads latest checkpoint for a process
- `aos.fromCheckpoint(txId)` → loads a specific checkpoint
- `aos.fromState(txId)` → downloads VM memory from `https://cu.ao-testnet.xyz/state/${txId}` and loads it
- `aos.asOwner(processId)` → derives default env from a live process
- `aos.fromOwner(txOrPid)` → resolves Process from a state TX (if given), sets env

Types
```ts
// AOS_Message
Record<string, string>

// AOS_Result
{
  Output: { data: string },
  Messages: Record<string, any>[],
  Spawns: Record<string, any>[],
  Assignments: Record<string, any>[]
}
```

## Checkpoints & Caching
- Checkpoints are fetched from Arweave and cached as `<txId>.bin` in CWD
- `fromState` fetches from the AO testnet state endpoint and also caches as `<txId>.bin`
- Large files are streamed to disk; subsequent runs reuse the cache
- Network is required for first load of module binary and checkpoints/state

## Testing
- All tests: `npm test`
- Single file: `npm test -- test/index.test.js`
- Name pattern: `npm test -- --test-name-pattern="basic"`

License: MIT
npm package: @permaweb/payments
Description: > WARNING: This is an experimental library, focused on the Universal Data License.
Latest version: 0.0.13

# Permaweb Payments Library

> WARNING: This is an experimental library, focused on the Universal Data License.

The Permaweb Payments library is a powerful tool that simplifies the handling of licensing workflows and payments on the permaweb. It provides an easy-to-use API for developers to integrate licensing functionality into their applications and interact with the Arweave blockchain.

## Features

- **License Workflow**: The library facilitates the licensing workflow, allowing developers to check if an address is licensed and initiate payments seamlessly.

- **Payment Handling**: Developers can easily integrate payment functionality into their applications using the library. It provides a straightforward API to initiate and process payments on the permaweb.

- **Integration with Arweave**: The library integrates with the Arweave blockchain, leveraging its decentralized and permanent storage capabilities for licensing and payment transactions.

## Installation

To install the Permaweb Payments library, use the following command:

```bash
npm install @permaweb/payments
```

## Usage

To initialize the library, import it into your project and call the `init` method with the contract and Arweave parameters:

> NOTE: It is important to use dependency injection and insert a connected contract with a signer

```javascript
import Payments from "@permaweb/payments";

const payments = Payments.init({ warp, wallet, gateway });
```

### Check License

To check if an address is licensed, use the `isLicensed` method:

```javascript
const isLicensed = await payments.isLicensed(contract, addr);
```

### Make a Payment

To initiate a payment, use the `pay` method:

```javascript
await payments.pay(contract, addr);
```

## Examples

Here are some examples to help you get started:

### Check License Example

```javascript
import Payments from "@permaweb/payments";

const payments = Payments.init({ warp, wallet, gateway });

const isLicensed = await payments.isLicensed(atomic-asset-id, wallet-addr);
console.log(`Address ${addr} is licensed: ${isLicensed}`);
```

### Make a Payment Example

```javascript
import Payments from "@permaweb/payments";

const payments = Payments.init({ warp, wallet, gateway });

await payments.pay(atomic-asset-id, wallet-addr);
console.log(`Payment sent to address: ${addr}`);
```

## Contributions

Contributions to the Permaweb Payments library are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the library's GitHub repository.

## License

The Permaweb Payments library is released under the [MIT License](https://opensource.org/licenses/MIT). Please refer to the LICENSE file for more details.

---

Thank you for using the Permaweb Payments library. We hope it simplifies the licensing and payment workflows for your permaweb applications. Happy building!
npm package: @permaweb/stampjs
Description: > Note: This library is intended for browser use only.
Latest version: 1.0.4

# STAMPS JS

> Note: This library is intended for browser use only.

STAMPS JS is the Software Development Kit (SDK) for the STAMP Protocol. Developers can use this SDK to integrate the STAMP Protocol into their applications.

## Installation

Install STAMPS JS using npm:

```sh
npm install @permaweb/stampjs
```

## Usage

Here's an example of how to use STAMPS JS:

```js
import Stamps from '@permaweb/stampjs';

// if using ArConnect you need to make sure the following PERMISSIONS are enabled
// * ACCESS_ADDRESS
// * DISPATCH
// * SIGN_TRANSACTION


// Initialize STAMPS JS, passing a process ID and delay
const stamps = Stamps.init({
  process: 'LaC2VtxqGekpRPuJh-TkI_ByAqCS2_KB3YuhMJ5yBtc', // Optional
  delay: 1000 // Optional - the length of time to wait between retries
});

// Stamp an asset
// SUPER STAMP: Optionally pass $STAMP quantity and tags
await stamps.stamp(TX, [qty], [tags]);

// Get stamp count for an asset
const { total } = await stamps.count(TX);

// Get counts for multiple assets
const counts = await stamps.counts(TXs);

> NOTE: hasStamped can take a single TX or a set of TXs

// Check if the user has already stamped the asset
const stamped = await stamps.hasStamped(TX);

or

const stampedResults = await stamps.hasStamped([TX1, TX2, TX3])

// or check if several Assets have been stamped
const results = await stamps.hasStamped([tx1, tx2, tx3])

// Get user's token balance
const balance = await stamps.balance();
```

For more information, visit the [STAMPS Protocol website](https://stamps.g8way.io).
npm package: @permaweb/wallet
Description: create arweave wallet file
Author: Tom Wilson
Latest version: 0.1.0

# Create arweave wallet file

A command line program that supports the following:
- creates a new arweave wallet json and prints to stdout
- parses an existing wallet json file and returns the pubkey

## Usage

```bash
node index.js
node index.js pubkey -f <path-to-wallet.json>
```
npm package: @permaweb/weavedrive
Description: SPEC: https://hackmd.io/@ao-docs/H1JK_WezR
Latest version: 0.0.18

# WeaveDrive

SPEC: https://hackmd.io/@ao-docs/H1JK_WezR

## Building

`npm run build`

## Testing

`npm test`

## Contributing

### Publish a new Version of the package

We use a Github workflow to build and publish new version of the Loader to NPM.
To publish a new version, go to the
[WeaveDrive CI workflow](https://github.com/permaweb/aos/actions/workflows/weavedrive.yml)
and click the `Run Workflow` button. Provide the semver compatible version you
would like to bump to, and then click `Run Workflow`. This will trigger a
Workflow Dispatch that will bump the version is the manifest files, build the module, and finally publish it to NPM
npm package: @permettezmoideconstruire/alma-client
Description: Typescript client for Alma (using axios)
Author: Cyril CHAPON
Latest version: 0.4.0

# @permettezmoideconstruire/alma-client

[![build status](https://img.shields.io/travis/permettez-moi-de-construire/alma-client?style=flat-square&logo=travis)](https://travis-ci.org/github/permettez-moi-de-construire/alma-client) [![code style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square&logo=javascript)](https://standardjs.com/) [![libraries status](https://img.shields.io/david/permettez-moi-de-construire/alma-client?style=flat-square&logo=npm)](https://david-dm.org/permettez-moi-de-construire/alma-client)

See [Documentation](https://permettez-moi-de-construire.github.io/alma-client)

## Install

```bash
yarn add @permettezmoideconstruire/alma-client
```

## Usage

```typescript
import type { AxiosResponse } from 'axios'

import {
  getClient,
  createPayment,
  AlmaPaymentOrderPayload,
  AlmaPayment
} from '@permettezmoideconstruire/alma-client'

// This creates and configure
// dedicated Axios instance for Alma
const almaClient = getClient(
  process.env.ALMA_API_KEY,
  // Optional but typically useful to switch to sandbox API endpoint
  process.env.ALMA_API_ENDPOINT
)

// API types helpers for payloads
const paymentOrderPayload: AlmaPaymentOrderPayload = {
  payment: {
    billing_address: {
      country: 'France'
    },
    purchase_amount: 150000
  }
}

// Each call is curryfied : method(almaClient)(data / options)
const result: AxiosResponse<Payment> = await createPayment(almaClient)(paymentOrderCreation)

// API types for returns
const payment: Payment = result.data
```
npm package: @permettezmoideconstruire/atlas-patrimoine-search
Description: Search l'atlas des patrimoines
Author: Cyril CHAPON
Latest version: 0.0.3

# atlas-patrimoine-search

Search [l'atlas des patrimoines](http://atlas.patrimoines.culture.fr/), JS style, with fixes

## installation

```
npm install atlas-patrimoine-search
```

```
import {
  Requester,
  ZONES,
  ZONES_REVERT
} from 'atlas-patrimoine-search'
```

// -- OR --

```
const {
  Requester,
  ZONES,
  ZONES_REVERT
} = require('atlas-patrimoine-search')
```

## usage

See [API documentation](doc/API.md)

## Scripts

* `npm run compile` - produce builds for the app
* `npm run test` - run tests
* `npm run build` - compile and run tests
* `npm run dev` - produces development version of your library and runs a watcher
* `npm run test:watch` - run tests in watch mode
npm package: @permettezmoideconstruire/cancellable-promise
Description: Non intrusive Promise wrapper to make it cancellable
Author: Cyril CHAPON
Latest version: 0.0.2

# webpack-library-starter

Non intrusive Promise wrapper to make it cancellable

[![Build status](https://travis-ci.org/permettez-moi-de-construire/cancellable-promise.svg?branch=master)](https://travis-ci.org/permettez-moi-de-construire/cancellable-promise.svg?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/f450bd914887df9c6ddc/maintainability)](https://codeclimate.com/github/permettez-moi-de-construire/cancellable-promise/maintainability)

## Installation

```
npm install @permettezmoideconstruire/cancellable-promise
```

or include

```
<script src="https://unpkg.com/@permettezmoideconstruire/cancellable-promise"></script>
```

You can specify a npm release with

```
<script src="https://unpkg.com/@permettezmoideconstruire/cancellable-promise@0.0.1"></script>
```

## Usage

```
// Import
import {
  cancellablePromise,
  CancelError,
  CancelToken
} from '@permettezmoideconstruire/cancellable-promise'

// --- OR ---

const {
  cancellablePromise,
  CancelError,
  CancelToken
} = require('@permettezmoideconstruire/cancellable-promise').default


// Wrap a promise
const initialPromise = SOMETHING_ASYNC()
const cancelToken = new CancelToken()
const wrappedPromise = cancellablePromise(initialPromise, cancelToken)


// Somewhere, cancel the promise...
cancelToken.cancel()


//Then catch it
wrappedPromise
.then((res) => {
  //Actual, usual fulfill
})
.catch((err) => {
  if(err instanceOf CancelError) {
    //Handle cancel error
  }

  //Handle actual, usual error
})
```

## Process

```
ES6 source files
       |
       |
    webpack
       |
       +--- babel, eslint
       |
  ready to use
     library
  in umd format
```

## Scripts

* `npm run compile` - produce builds for the app
* `npm run test` - run tests
* `npm run build` - compile and run tests
* `npm run dev` - produces development version of your library and runs a watcher
* `npm run test:watch` - run tests in watch mode
npm package: @permettezmoideconstruire/georss-to-geojson
Description: Library to convert GeoRSS (XML) file into GeoJSON format.
Author: Loïc PIREZ
Latest version: 1.0.3

# GeoRss to GeoJSON

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) [![Build Status](https://travis-ci.org/permettez-moi-de-construire/georss-to-geojson.svg?branch=master)](https://travis-ci.org/permettez-moi-de-construire/georss-to-geojson)

> Library to convert GeoRSS Tag into GeoJSON Feature.

## Usage

You need to convert your GeoRss tag with [xml-js](https://github.com/nashwaan/xml-js) module and pass the tag to this module.

```RssToGeoJson.convert(xmlJson)```

## Exemple

See `exemples/index.js` for featured exemple.

## Limitation

For the moment, this module support only `<georss:polygon>` tag.
npm package: @permettezmoideconstruire/gml-to-geojson
Description: Translate gml geometries to geojson
Author: Cyril CHAPON
Latest version: 0.0.5

# gml-to-geojson

Translate gml geometries to geojson

[![Build status](https://travis-ci.org/permettez-moi-de-construire/webpack-library-starter.svg?branch=master)](https://travis-ci.org/permettez-moi-de-construire/webpack-library-starter.svg?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/<badgeid>/maintainability)](https://codeclimate.com/github/permettez-moi-de-construire/webpack-library-starter/maintainability)

## Installation

```
npm install @permettezmoideconstruire/gml-to-geojson
```

## Usage

See [API documentation](doc/API.md)

## Scripts

* `npm run compile` - produce builds for the app
* `npm run test` - run tests
* `npm run build` - compile and run tests
* `npm run dev` - produces development version of your library and runs a watcher
* `npm run test:watch` - run tests in watch mode
npm package: @permettezmoideconstruire/pdf-filler
Description: This package is a simple [pdf-lib](https://github.com/Hopding/pdf-lib) abstraction, for Node.js
Latest version: 0.0.2

# pdf-filler

This package is a simple [pdf-lib](https://github.com/Hopding/pdf-lib) abstraction, for Node.js

## Installation

```
yarn add @permettezmoideconstruire/pdf-filler

# or

npm install --save @permettezmoideconstruire/pdf-filler
```

## Usage

```
// Import it
const {
  fillPdf,
  fonts,
  CENTER
} = require('@permettezmoideconstruire/pdf-filler')

const fs = require('fs').promises
const inputFileBytes = await fs.readFile('./input.pdf')

const outPutFileBytes = await fillPdf(inputFileBytes, {
  texts: [
    {
      // Text in string
      value: 'foo Bar !',
      // Number (px) or CENTER
      x: CENTER,
      // Number (px) or CENTER
      y: 200,
      // Number (px)
      size: 13,
      // [R, G, B]
      color: [0xFF, 0, 0XFF],
      // Page index (0 based)
      page: 0
    }
  ],
  font: fonts.HelveticaBold
})

await fs.writeFile(outPutFileBytes, './output.pdf')
```

## API

### `async fillPdf(inputFile, options)`

- **inputFile**
*Uint8Array* or *ArrayBuffer* (straightly passed to [pdf-lib.PDFDocument.load](https://github.com/Hopding/pdf-lib#modify-document))
- **options**
  - `options.texts` An array of fillers descriptors
    - `options.texts[].value` String of text. **Mandatory**
    - `options.texts[].x` Horizontal position of text. Must be a number (pixels), or the constant CENTER. When using number, text is left-aligned; when using center, text is centered. Default **0**
    - `options.texts[].y` Vertical position of text. Must be a number (pixels), or the constant CENTER. When using number, text is bottom-aligned; when using center, text is centered. Default **0**
    - `options.texts[].size` Font size in number (pixels). Default **13**
    - `options.texts[].page` Page index where the text should appear, 0-based. Default **0**
  - `options.font` Font to use for texts. Must be a standard font, a string containing its name. A constants `fonts` is exported to help for that.
npm package: @permettezmoideconstruire/png-to-geojson
Description: DESCRIPTION HERE
Author: Cyril CHAPON
Latest version: 0.0.4

# webpack-library-starter

Webpack based boilerplate for producing libraries (Input: ES6, Output: universal library)

[![Build status](https://travis-ci.org/permettez-moi-de-construire/webpack-library-starter.svg?branch=master)](https://travis-ci.org/permettez-moi-de-construire/webpack-library-starter.svg?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/<badgeid>/maintainability)](https://codeclimate.com/github/permettez-moi-de-construire/webpack-library-starter/maintainability)

## Process

```
ES6 source files
       |
       |
    webpack
       |
       +--- babel, eslint
       |
  ready to use
     library
  in umd format
```

## Scripts

* `npm run compile` - produce builds for the app
* `npm run test` - run tests
* `npm run build` - compile and run tests
* `npm run dev` - produces development version of your library and runs a watcher
* `npm run test:watch` - run tests in watch mode
npm package: @permettezmoideconstruire/react-map-gl
Description: A React wrapper for MapboxGL-js and overlay API.
Latest version: 4.0.0-beta.7

<p align="right">
  <a href="https://npmjs.org/package/react-map-gl">
    <img src="https://img.shields.io/npm/v/react-map-gl.svg?style=flat-square" alt="version" />
  </a>
  <a href="https://travis-ci.org/uber/react-map-gl">
    <img src="https://img.shields.io/travis/uber/react-map-gl/master.svg?style=flat-square" alt="build" />
  </a>
  <a href="https://npmjs.org/package/react-map-gl">
    <img src="https://img.shields.io/npm/dm/react-map-gl.svg?style=flat-square" alt="downloads" />
  </a>
</p>

<h1 align="center">react-map-gl | <a href="https://uber.github.io/react-map-gl">Docs</a></h1>

<h5 align="center">
React Components Suite for <a href="https://github.com/mapbox/mapbox-gl-js">Mapbox GL JS</a>.
</h5>

In addition to exposing MapboxGL functionality to React apps, react-map-gl also integrates seamlessly with [deck.gl](https://uber.github.io/deck.gl).

### Before You Begin
This library provides convenient wrappers around initializing and (to some degree) tracking the state of a Mapbox WebGL map. Because most of the functionality of Mapbox's JS API depends on the use of HTML5 canvases and WebGL, which React is not built to manipulate, the React component does not mirror all the functionality of Mapbox GL JS's Map class. You may access the native Mapbox API exposed by the `getMap()` function in this library. However, proceed with caution as calling the native APIs may break the connection between the React layer props and the underlying map state.

### Installation

Using `react-map-gl` requires `react >= 16.3`.

```sh
npm install --save react-map-gl
```

### Example

```js
import {Component} from 'react';
import ReactMapGL from 'react-map-gl';

class Map extends Component {

  state = {
    viewport: {
      width: 400,
      height: 400,
      latitude: 37.7577,
      longitude: -122.4376,
      zoom: 8
    }
  };

  render() {
    return (
      <ReactMapGL
        {...this.state.viewport}
        onViewportChange={(viewport) => this.setState({viewport})}
      />
    );
  }
}
```

### About Mapbox Tokens

To show maps from a service such as Mapbox you will need to register on their website in order to retrieve an access token required by the map component, which will be used to identify you and start serving up map tiles. The service will be free until a certain level of traffic is exceeded.

There are several ways to provide a token to your app, as showcased in some of the example folders:

* Provide a `mapboxApiAccessToken` prop to the map component
* Set the `MapboxAccessToken` environment variable (or set `REACT_APP_MAPBOX_ACCESS_TOKEN` if you are using Create React App)
* Provide it in the URL, e.g `?access_token=TOKEN`

But we would recommend using something like [dotenv](https://github.com/motdotla/dotenv) and put your key in an untracked `.env` file, that will then expose it as a `process.env` variable, with much less leaking risks.

### Contribute

See [developer guide](docs/developer-guide.md).
npm package: @permettezmoideconstruire/traverse-geojson
Description: Deeply map geojson object to traverse it's coordinates, and more
Author: Cyril CHAPON
Latest version: 0.0.1-alpha

# traverse-geojson

Deeply traverse geojson coordinates

[![Build status](https://travis-ci.org/permettez-moi-de-construire/webpack-library-starter.svg?branch=master)](https://travis-ci.org/permettez-moi-de-construire/webpack-library-starter.svg?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/<badgeid>/maintainability)](https://codeclimate.com/github/permettez-moi-de-construire/webpack-library-starter/maintainability)

## Installation

```
npm install @permettezmoideconstruire/traverse-geojson
```

## Usage

See [API documentation](doc/API.md)

## Scripts

* `npm run compile` - produce builds for the app
* `npm run test` - run tests
* `npm run build` - compile and run tests
* `npm run dev` - produces development version of your library and runs a watcher
* `npm run test:watch` - run tests in watch mode
npm package: @permettezmoideconstruire/utm-parser
Description: Store query utm parameters to a get/set store
Author: Cyril CHAPON
Latest version: 1.0.0

# utm-parser

Webpack based boilerplate for producing libraries (Input: ES6, Output: universal library)

[![Build status](https://travis-ci.org/permettez-moi-de-construire/store-utm.svg?branch=master)](https://travis-ci.org/permettez-moi-de-construire/store-utm.svg?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/85b6789bb4dbdf459f04/maintainability)](https://codeclimate.com/github/permettez-moi-de-construire/store-utm/maintainability)

## Process

```
ES6 source files
       |
       |
    webpack
       |
       +--- babel, eslint
       |
  ready to use
     library
  in umd format
```

## Scripts

* `npm run compile` - produce builds for the app
* `npm run test` - run tests
* `npm run build` - compile and run tests
* `npm run dev` - produces development version of your library and runs a watcher
* `npm run test:watch` - run tests in watch mode
npm package: @permi/ts
Description: TypeScript SDK for Permi API
Author: Permi
Latest version: 0.0.12

# @permi/ts

TypeScript SDK for Permi API - A simple client for interacting with Permi's universal wallet service.

## Installation

```bash
npm install @permi/ts
# or
pnpm add @permi/ts
# or
yarn add @permi/ts
```

## Usage

### Basic Setup

```typescript
import { Permi } from "@permi/ts";

// Initialize the client
const permi = new Permi({
  baseUrl: "https://permi.xyz", // optional, defaults to https://permi.xyz
  getAccessToken: async () => {
    // Return your access token
    return "your-access-token";
  },
});
```

### Get Wallet Address

```typescript
const address = await permi.address();
console.log(address); // 0x...
```

### Get Wallet Balance

```typescript
const balance = await permi.balance();
console.log(balance);
```

### Sign Messages

```typescript
// Sign a simple message
const signature = await permi.signMessage({
  message: "Hello, world!",
});
console.log(signature); // 0x...
```

### Sign Transactions

```typescript
const signature = await permi.signTransaction({
  to: "0x...",
  value: BigInt(1000000000000000000), // 1 ETH in wei
  // ... other transaction fields
});
```

### Sign Typed Data (EIP-712)

```typescript
const signature = await permi.signTypedData({
  domain: {
    name: "MyApp",
    version: "1",
    chainId: 1,
    verifyingContract: "0x...",
  },
  types: {
    Person: [
      { name: "name", type: "string" },
      { name: "wallet", type: "address" },
    ],
  },
  primaryType: "Person",
  message: {
    name: "Alice",
    wallet: "0x...",
  },
});
```

### Using with Viem

The SDK exports utilities for integration with [viem](https://viem.sh):

```typescript
import { Permi } from "@permi/ts";
import { toAccount } from "@permi/ts/viem";
import { createWalletClient, http } from "viem";
import { mainnet } from "viem/chains";

const permi = new Permi({
  getAccessToken: async () => "your-access-token",
});

// Create a viem account from Permi
const account = await toAccount(permi);

// Use with viem wallet client
const walletClient = createWalletClient({
  account,
  chain: mainnet,
  transport: http(),
});

// Now you can use standard viem methods
const hash = await walletClient.sendTransaction({
  to: "0x...",
  value: BigInt(1000000000000000000),
});
```

## API Reference

### `Permi`

#### Constructor

```typescript
new Permi(config?: PermiConfig, address?: Address)
```

- `config.baseUrl` - Optional API base URL (defaults to https://permi.xyz)
- `config.getAccessToken` - Optional function to retrieve access token
- `address` - Optional cached wallet address

#### Methods

- `address(): Promise<Address>` - Get the wallet address
- `balance(): Promise<BalanceData>` - Get the wallet balance
- `signMessage({ message }): Promise<Hex>` - Sign a message
- `signTransaction(transaction): Promise<Hex>` - Sign a transaction
- `signTypedData(data): Promise<Hex>` - Sign typed data (EIP-712)

## License

MIT
npm package: @permify-toolkit/cli
Description: Powerful CLI for Permify: Push schemas, seed relationships, and manage tenants with ease.
Author: Nikhil aka thisisnkc
Latest version: 1.3.0

# @permify-toolkit/cli

[![NPM Version](https://img.shields.io/npm/v/@permify-toolkit/cli)](https://www.npmjs.com/package/@permify-toolkit/cli)
[![License](https://img.shields.io/github/license/thisisnkc/permify-toolkit)](https://github.com/thisisnkc/permify-toolkit/blob/main/LICENSE)

CLI for pushing schemas and seeding relationships to [Permify](https://github.com/Permify/permify).

## Installation

```bash
pnpm add -D @permify-toolkit/cli
```

## Quick Example

```bash
# Push schema from permify.config.ts
permify-toolkit schema push

# Seed relationships from a JSON file
permify-toolkit relationships seed --file-path ./data/relationships.json

# Push to a new tenant (creates it if needed)
permify-toolkit schema push --tenant new-tenant -c
```

## Commands

| Command              | Description                        |
| -------------------- | ---------------------------------- |
| `schema push`        | Push schema to Permify server      |
| `relationships seed` | Seed relationship tuples from JSON |

## Features

- **Shared Config** — reads from `permify.config.ts`, no flag duplication
- **Inline or File Schemas** — TypeScript DSL or `.perm` files
- **Tenant Management** — auto-create tenants with `--create-tenant`
- **Schema Validation** — Permify validates on push with detailed error messages

## Documentation

For full documentation, guides, and API reference, visit the **[Permify Toolkit Docs](https://thisisnkc.github.io/permify-toolkit/)**.
npm package: @permify-toolkit/core
Description: The ultimate TypeScript engine for Permify: Type-safe schema DSL, simplified client, and shared configuration.
Author: Nikhil aka thisisnkc
Latest version: 1.3.0

# @permify-toolkit/core

[![NPM Version](https://img.shields.io/npm/v/@permify-toolkit/core)](https://www.npmjs.com/package/@permify-toolkit/core)
[![License](https://img.shields.io/github/license/thisisnkc/permify-toolkit)](https://github.com/thisisnkc/permify-toolkit/blob/main/LICENSE)

Type-safe schema DSL, client factory, and permission/relationship helpers for [Permify](https://github.com/Permify/permify).

## Installation

```bash
pnpm add @permify-toolkit/core
```

## Quick Example

```typescript
import {
  schema,
  entity,
  relation,
  permission,
  defineConfig
} from "@permify-toolkit/core";

export default defineConfig({
  tenant: "t1",
  client: { endpoint: "localhost:3478", insecure: true },
  schema: schema({
    user: entity({}),
    document: entity({
      relations: { owner: relation("user"), editor: relation("user") },
      permissions: {
        edit: permission("owner", "editor"),
        view: permission("owner", "editor")
      }
    })
  })
});
```

```typescript
import { createPermifyClient, checkPermission } from "@permify-toolkit/core";

const client = createPermifyClient({
  endpoint: "localhost:3478",
  insecure: true
});

const { allowed } = await checkPermission(client, {
  tenantId: "t1",
  entity: { type: "document", id: "doc-1" },
  permission: "view",
  subject: { type: "user", id: "user-123" }
});
```

## Features

- **Type-Safe Schema DSL** — define entities, relations, and permissions with full IDE autocomplete
- **Client Factory** — create gRPC clients from code or environment variables
- **Permission Checks** — simplified `checkPermission()` single-function calls
- **Relationship Management** — `writeRelationships()` and `deleteRelationships()` helpers
- **Shared Config** — `permify.config.ts` powers your app, CLI, and NestJS module

## Documentation

For full documentation, guides, and API reference, visit the **[Permify Toolkit Docs](https://thisisnkc.github.io/permify-toolkit/)**.
npm package: @permission-protocol/sdk
Description: Official JavaScript/TypeScript SDK for Permission Protocol
Author: Permission Protocol
Latest version: 0.1.0

# @permissionprotocol/sdk

Official JavaScript/TypeScript SDK for Permission Protocol.

## Install

```bash
npm install @permissionprotocol/sdk
```

## Quickstart

```ts
import { configure, authorize } from "@permissionprotocol/sdk";

configure("pp_live_xxx", "https://app.permissionprotocol.com");

const receipt = await authorize(
  "deploy",
  "billing-service",
  "deploy-bot",
  { pr: 42 },
  true,
  300
);

console.log(receipt.id);
console.log(receipt.status);
console.log(receipt.valid);
console.log(receipt.json());
```

You can skip `configure()` by setting:

- `PP_API_KEY` (required)
- `PP_BASE_URL` (optional, defaults to `https://app.permissionprotocol.com`)

## API

### `configure(apiKey, baseUrl?)`

Set SDK credentials and API base URL.

### `authorize(action, resource, actor?, metadata?, wait?, timeout?)`

Create an approval request and return a `Receipt`.  
When `wait` is `true` (default), the SDK polls until approved, denied, expired, or timeout.

### `verify(receiptId)`

Verify a receipt and return a `Receipt` with `.valid`.

### `requireApproval(options)`

Higher-order wrapper for function execution:

```ts
import { requireApproval } from "@permissionprotocol/sdk";

const deploy = requireApproval({
  resource: "billing-service",
  action: "deploy"
})(async () => {
  return "deploy complete";
});

await deploy();
```

## Exceptions

- `PermissionProtocolError`
- `PermissionDenied`
- `ApprovalTimeout`

## License

MIT
npm package: @permitdev/react
Description: React SDK for Permit authentication-as-a-service
Author: Permit
Latest version: 0.4.1

# @permitdev/react

React SDK for Permit Embedded Authentication.

## Installation

```bash
npm install @permitdev/react
# or
pnpm add @permitdev/react
```

## Quick Start

### 1. Wrap your app with PermitProvider

```tsx
import { PermitProvider } from '@permitdev/react';

function App() {
  return (
    <PermitProvider
      projectId="your-project-id"
      config={{ apiUrl: 'https://your-api.com/api/v1' }}
    >
      <YourApp />
    </PermitProvider>
  );
}
```

### 2. Use the usePermit hook

```tsx
import { usePermit } from '@permitdev/react';

function Profile() {
  const { isAuthenticated, user, login, logout, isLoading } = usePermit();

  if (isLoading) return <div>Loading...</div>;

  if (!isAuthenticated) {
    return <button onClick={login}>Login</button>;
  }

  return (
    <div>
      <p>Welcome, {user?.email}!</p>
      <button onClick={logout}>Logout</button>
    </div>
  );
}
```

### 3. Use the PermitButton component

```tsx
import { PermitButton } from '@permitdev/react';

function Header() {
  return <PermitButton />;
}
```

## API Reference

### PermitProvider

| Prop | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Yes | Your Permit project ID |
| `config.apiUrl` | `string` | No | API base URL (default: `http://localhost:8080/api/v1`) |
| `config.theme` | `'light' \| 'dark'` | No | Theme mode |

### usePermit Hook

Returns:

| Property | Type | Description |
|----------|------|-------------|
| `isAuthenticated` | `boolean` | Whether user is logged in |
| `isLoading` | `boolean` | Loading state |
| `user` | `{ id: string, email: string } \| null` | Current user |
| `token` | `string \| null` | Access token |
| `login` | `() => void` | Opens login modal |
| `logout` | `() => void` | Logs out user |
| `widgetConfig` | `object \| null` | Project widget configuration |
| `configError` | `string \| null` | Configuration error message |

## Development

```bash
# Install dependencies
pnpm install

# Start dev server
pnpm dev

# Build
pnpm build

# Run tests
pnpm test
```

## License

MIT
npm package: @permitdev/server
Description: Server SDK for Permit authentication - JWT validation and middleware
Author: Permit
Latest version: 0.1.0

# @permitdev/server

Server SDK for Permit authentication - JWT validation and middleware for Node.js backends.

## Installation

```bash
npm install @permitdev/server
# or
pnpm add @permitdev/server
# or
yarn add @permitdev/server
```

## Quick Start

### Basic Token Verification

```typescript
import { PermitAuth } from '@permitdev/server';

const permit = new PermitAuth({
  clientId: process.env.PERMIT_CLIENT_ID!,
  clientSecret: process.env.PERMIT_CLIENT_SECRET!,
});

const result = await permit.verifyToken(accessToken);

if (result.valid) {
  console.log('User ID:', result.user.userId);
  console.log('Email:', result.user.email);
} else {
  console.log('Error:', result.errorCode, result.error);
}
```

### Express Middleware

```typescript
import express from 'express';
import { createPermitMiddleware } from '@permitdev/server/middleware';

const app = express();

app.use('/api/protected', createPermitMiddleware({
  clientId: process.env.PERMIT_CLIENT_ID!,
  clientSecret: process.env.PERMIT_CLIENT_SECRET!,
}));

app.get('/api/protected/me', (req, res) => {
  res.json({ user: req.permitUser });
});
```

### Next.js App Router

```typescript
// app/api/protected/route.ts
import { withPermitAuth } from '@permitdev/server/next';

export const GET = withPermitAuth(async (req, { user }) => {
  return Response.json({
    message: `Hello ${user.email}`,
    userId: user.userId,
  });
}, {
  clientId: process.env.PERMIT_CLIENT_ID!,
  clientSecret: process.env.PERMIT_CLIENT_SECRET!,
});
```

## API Reference

### PermitAuth

Main class for token verification.

```typescript
const permit = new PermitAuth({
  clientId: string,       // Required: pk_... from dashboard
  clientSecret: string,   // Required: sk_... from dashboard
  baseUrl?: string,       // Optional: API URL (default: https://api.permit.dev)
  cacheTtl?: number,      // Optional: JWKS cache TTL in ms (default: 24h)
});

const result = await permit.verifyToken(token);
```

### VerificationResult

```typescript
interface VerificationResult {
  valid: boolean;
  user?: PermitUser;
  error?: string;
  errorCode?: ErrorCode;
}

interface PermitUser {
  userId: string;
  email: string;
  appId: string;
  provider: string;
  issuedAt: Date;
  expiresAt: Date;
}
```

### Error Codes

| Code | Description |
|------|-------------|
| `TOKEN_EXPIRED` | Token has expired |
| `INVALID_SIGNATURE` | Signature verification failed |
| `INVALID_ISSUER` | Token issuer mismatch |
| `INVALID_AUDIENCE` | Token audience mismatch |
| `MALFORMED_TOKEN` | Token format is invalid |
| `JWKS_FETCH_FAILED` | Could not fetch JWKS keys |
| `INVALID_CREDENTIALS` | clientId/clientSecret invalid |
| `CREDENTIALS_REQUIRED` | Missing clientId or clientSecret |

## Security

⚠️ **IMPORTANT**: Never expose your `clientSecret` (sk_...) to the client. Store it in environment variables and only use it in server-side code.

## Client SDK

For the React client SDK, see [@permitdev/react](https://www.npmjs.com/package/@permitdev/react).

## License

MIT
npm package: @permitio/permit-react
Description: permit-react
Author: Igor Gaponov
Latest version: 1.0.6

# permit-react-sdk

usage:
```typescript
<PermitProvider loginMethod={LoginMethod.cookie} loginUrl={`${customerBackendUrl}/login_cookie`} >
<BrowserRouter>
    <Routes>
    <Route path="/" element={<Dashboard />} />
    <Route path="/users" element={<UserManagementEmbed embedUrl={"https://embed.permit.io/<ELEMENT_ID>?envId=<ENV_ID>"} />} />
    </Routes>
</BrowserRouter>
</PermitProvider>
```

Provider props:
```typescript
export interface PermitProviderProps {
  loginUrl: string
  tenant?: string
  loginMethod: LoginMethod
  token?: string
  children: React.ReactNode
  headers?: Record<string, string>
  onError?: (error: any) => void
  onLogin?: (res: any) => void
  errorComponent?: React.ReactNode
}
```
Embed props:
```typescript
interface Props {
  embedUrl: string
  width?: string
  height?: string
  style?: React.CSSProperties
}
```