open-index/open-npm huggingface dataset:
npm package: @nymphjs/client
Description: Nymph.js - Client
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Nymph Client

Powerful object data storage and querying.

The Nymph Client allows you to query and push data to a Nymph REST server from the browser or Node.js. You can also subscribe to entities and queries on a Nymph PubSub server and be notified of changes.

## Installation

```sh
npm install --save @nymphjs/client
```

This package is the Nymph client for browsers and Node.js, but requires at least Node.js 22 to be used in Node. You can find ES modules in `dist`, or TS source in `src`.

## Usage

Here's an overview:

```ts
import { Nymph, PubSub } from '@nymphjs/client';
import TodoClass from './Todo.js';

const nymphOptions = {
  restUrl: 'https://yournymphrestserver/path/to/your/endpoint',
  pubsubUrl: 'wss://yournymphpubsubserver',
};
const nymph = new Nymph(nymphOptions);
const pubsub = new PubSub(nymphOptions, nymph);
const Todo = nymph.addEntityClass(TodoClass);

// Now you can use Nymph and PubSub.
const myTodo = new Todo();
myTodo.name = 'This is a new todo!';
myTodo.done = false;
await myTodo.$save();

let allMyTodos = await nymph.getEntities({ class: Todo });

let subscription = pubsub.subscribeWith(myTodo, () => {
  // When this is called, the entity will already contain new data from the
  // publish event. If the entity is deleted, the GUID will be set to null.
  if (myTodo.guid != null) {
    alert('Somebody touched my todo!');
  } else {
    alert('Somebody deleted my todo!');
    subscription.unsubscribe();
  }
});

// ...

// Subscribing to a query.
let todos = [];
let userCount = 0;
let subscription = pubsub.subscribeEntities(
  {
    class: Todo.class,
  },
  {
    type: '&',
    '!tag': 'archived',
  },
)(
  (update) => {
    // The first time this is called, `update` will be an array of Todo
    // entities. After that, `update` will be a publish event object.

    // This takes an existing array of entities and either updates it to match
    // another array, or performs actions from a publish event object to update
    // it.
    pubsub.updateArray(todos, update);

    // `todos` is now up to date with the latest publishes from the server.
  },
  (err) => alert(err),
  (count) => {
    // If you provide this callback, the server will send updates of how many
    // clients are subscribed to this query.
    userCount = count;
  },
);

// ...

// Remember to clean up your subscriptions when you no longer need them.
subscription.unsubscribe();
```

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/client-node
Description: Nymph.js - Node Client
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Nymph Node Client

Powerful object data storage and querying.

This package is no longer needed, because Node.js since version 22 provides both `fetch` and `WebSocket`. Instead, use the [regular Nymph.js client package](https://www.npmjs.com/package/@nymphjs/client).

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/driver-mysql
Description: Nymph.js - MySQL DB Driver
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Nymph MySQL Driver

Powerful object data storage and querying.

The MySQL driver lets you configure Nymph to query and save data to a MySQL database.

## Installation

```sh
npm install --save @nymphjs/driver-mysql
```

## Usage

Supply an instance of this driver with its configuration to Nymph's constructor.

```ts
import { Nymph } from '@nymphjs/nymph';
import MySQLDriver from '@nymphjs/driver-mysql';

const mysqlConfig = {
  host: 'your_db_host',
  database: 'your_database',
  user: 'your_user',
  password: 'your_password',
};

const nymph = new Nymph({}, new MySQLDriver(mysqlConfig));

// All done. Nymph is ready to use.
```

## Options

See the [config declaration file](src/conf/d.ts).

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/driver-postgresql
Description: Nymph.js - PostgreSQL DB Driver
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Nymph PostgreSQL Driver

Powerful object data storage and querying.

The PostgreSQL driver lets you configure Nymph to query and save data to a Postgres database.

## Installation

```sh
npm install --save @nymphjs/driver-postgresql
```

## Usage

Supply an instance of this driver with its configuration to Nymph's constructor.

```ts
import { Nymph } from '@nymphjs/nymph';
import PostgreSQLDriver from '@nymphjs/driver-postgresql';

const postgresqlConfig = {
  host: 'your_db_host',
  database: 'your_database',
  user: 'your_user',
  password: 'your_password',
};

const nymph = new Nymph({}, new PostgreSQLDriver(postgresqlConfig));

// All done. Nymph is ready to use.
```

## Options

See the [config declaration file](src/conf/d.ts).

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/driver-sqlite3
Description: Nymph.js - SQLite3 DB Driver
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Nymph SQLite3 Driver

Powerful object data storage and querying.

The SQLite3 driver lets you configure Nymph to query and save data to a SQLite3 database. This includes an in memory SQLite3 database.

## Installation

```sh
npm install --save @nymphjs/driver-sqlite3
```

## Usage

Supply an instance of this driver with its configuration to Nymph's constructor.

```ts
import { Nymph } from '@nymphjs/nymph';
import SQLite3Driver from '@nymphjs/driver-sqlite3';

const sqliteConfig = {
  filename: __dirname + '/mydatabase.db',
};

const nymph = new Nymph({}, new SQLite3Driver(sqliteConfig));

// All done. Nymph is ready to use.
```

## Options

See the [config declaration file](src/conf/d.ts).

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/guid
Description: Nymph.js - GUID and Unique Code Generators
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Nymph GUID / Unique Code Generator

Powerful object data storage and querying.

The GUID and unique code generators are used to generate new GUIDs for Nymph objects and various random unique strings.

## Installation

```sh
npm install --save @nymphjs/guid
```

## Usage

There are a few functions for generating different kinds of strings.

```ts
import {
  guid,
  makeTableSuffix,
  humanSecret,
  nanoid,
  customAlphabet,
} from '@nymphjs/guid';

// This generates a GUID. It will be 24 characters long, and the first four
// characters will be the same during a whole week. (This helps make DB index
// paging more efficient.)
const myGuid = guid();

// This can be used as a table suffix in SQL queries. It will be 20 characters
// long and alphanumeric.
const myTableSuffix = makeTableSuffix();

// This will be a human readable secret code. It will be 10 characters long and
// use the nolookalikesSafe dictionary from nanoid-dictionary.
const mySecretCode = humanSecret();

// This is the nanoid library's main export. It is exported in commonjs format.
const id = nanoid();

// This is the nanoid library's customAlphabet export.
const customId = customAlphabet('abc', 20)();
```

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/sorter
Description: Nymph.js - Sorter
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Nymph Entity Sorter

Powerful object data storage and querying.

The Nymph Entity Sorter lets you sort entities by their properties, including hierarchically.

## Installation

```sh
npm install --save @nymphjs/sorter
```

## Usage

Here's an overview:

```ts
import { Nymph } from '@nymphjs/nymph';
// or
import { Nymph } from '@nymphjs/client';
import PageClass from './Page.js';

import { Sorter } from '@nymphjs/sorter';

const nymphOptions = {
  // the options for your Nymph instance.
};
const nymph = new Nymph(nymphOptions);
const Page = nymph.addEntityClass(PageClass);

let pages = await nymph.getEntities({ class: Page });

const sorter = new Sorter(pages);

//
// ## Simple sort by some property.
//

sorter.sort('name');
// Pages are now sorted by name, with locale aware sorting.
console.log(pages);

sorter.sort('cdate');
// Pages are now sorted by creation date.
console.log(pages);

sorter.sort('cdate', { reverse: true });
// Pages are now sorted by creation date, newest first.
console.log(pages);

// Specifying your own comparator.
sorter.sort('name', { comparator: (a, b) => (a < b ? -1 : a > b ? 1 : 0) });
// Pages are now sorted by name, based on UTF-16 code points.
console.log(pages);

// Specifying options to the collator.
sorter.sort('name', {
  collatorOptions: {
    sensitivity: 'case',
    caseFirst: 'upper',
    numeric: true,
  },
});
// Pages are now sorted by name, with uppercase coming first in case of
// otherwise identical entries, and numbers being sorted logically (2 < 10).
console.log(pages);

//
// ## Hierarchical sorting.
//

sorter.hsort('name', 'parent');
// Pages are now sorted by name, hierarchically. (All child pages come
// immediately after their parent.)
console.log(pages);

// You can specify the same options as before.
sorter.hsort('name', 'parent', {
  collatorOptions: {
    sensitivity: 'case',
    caseFirst: 'upper',
    numeric: true,
  },
});
// Pages are now sorted by name, hierarchically, with uppercase coming first
// in case of otherwise identical entries, and numbers being sorted
// logically (2 < 10).
console.log(pages);
```

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/tilmeld
Description: Nymph.js - Tilmeld User and Group System
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Tilmeld - User/Group System for Nymph

Powerful object data storage and querying.

Tilmeld (the d is silent) is a user and group management system for Nymph. It provides strict access controls to protect entities from unauthorized access/modification. It allows for granting and revoking ad hoc abilities to users and groups, then checking for those abilities. It provides authentication services and features protection against XSRF attacks.

## Installation

```sh
npm install --save @nymphjs/tilmeld
```

## Usage

When you initialize Nymph, provide it with an instance of the Tilmeld class from this package. You now have access to the User and Group classes that are specific to that instance of Nymph/Tilmeld.

Here's an overview.

```ts
import SQLite3Driver from '@nymphjs/driver-sqlite3';
import { Tilmeld } from '@nymphjs/tilmeld';
import { Nymph } from '@nymphjs/nymph';

const tilmeld = new Tilmeld({
  appName: 'My App',
  appUrl: 'http://localhost',
  cookieDomain: 'localhost',
  cookiePath: '/',
  setupPath: '/user',
  verifyRedirect: 'http://localhost',
  verifyChangeRedirect: 'http://localhost',
  cancelChangeRedirect: 'http://localhost',
  jwtSecret: 'shhhhh',
});

const nymph = new Nymph(
  {},
  new SQLite3Driver({
    filename: ':memory:',
  }),
  tilmeld,
);

// These are the classes specific to this instance of Tilmeld.
const { User, Group } = tilmeld;
```

## Options

See the [config declaration file](src/conf/d.ts).

## Abilities

There are a few abilities that Tilmeld uses internally:

- `system/admin` - A user with this ability has **all** abilities.
- `tilmeld/admin` - Allow the user to manage and edit other user's account and group information and grant/revoke abilities.
- `tilmeld/switch` - Allow the user to switch to other users (log in as them without their password).
- `uid/get/[name]` - Allow the user to read the named UID.
- `uid/new/[name]` - Allow the user to read, create, and increment the named UID.
- `uid/set/[name]` - Allow the user to read, create, increment, set, and delete the named UID.

The admin and switch abilities cannot be inherited from groups.

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/tilmeld-client
Description: Nymph.js - Tilmeld Client
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Tilmeld Client - User/Group System for Nymph

Powerful object data storage and querying.

The Tilmeld Client lets you register, login, and perform user account related functions remotely on a Nymph server.

## Installation

```sh
npm install --save @nymphjs/tilmeld-client
```

You can find ES modules in `dist`, or TS source in `src`.

## Usage

The Tilmeld client contains the client versions of the `User` and `Group` entities. It also contains helpers, `login`, `register`, and `checkUsername`.

Once you've initialized Nymph Client, set the User and Group classes on it. Then initialize the new User class with the Nymph instance. (This allows the class to set up authentication listeners.)

```ts
import { Nymph } from '@nymphjs/client';
import {
  User as UserClass,
  Group as GroupClass,
} from '@nymphjs/tilmeld-client';

const nymph = new Nymph({
  restUrl: 'https://yournymphrestserver/path/to/your/endpoint',
});
const User = nymph.addEntityClass(UserClass);
const Group = nymph.addEntityClass(GroupClass);
User.init(nymph);
```

If you're running more than one instance of Nymph client, be sure to use the classes returned by `addEntityClass`, so as not to accidentally submit entities from one instances to another instance.

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/tilmeld-components
Description: Nymph.js - Tilmeld Front End Components
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Tilmeld Components - User/Group System for Nymph

Powerful object data storage and querying.

The Tilmeld Components are front end registration/login, account recovery, account details, and password change components built with [Svelte](https://svelte.dev/) and [SMUI](https://sveltematerialui.com/).

## Installation

```sh
npm install --save @nymphjs/tilmeld-components
```

## Usage

You need to have an SMUI theme compiled and installed on your front end app. If you're using Svelte, you need to have TypeScript support and you should use the 'svelte' mainfield from package.json.

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymphjs/tilmeld-setup
Description: Nymph.js - Tilmeld Setup App
Author: Hunter Perrin
Latest version: 1.0.0-beta.116

# Tilmeld Setup App - User/Group System for Nymph

Powerful object data storage and querying.

The Tilmeld Setup App allows administrators to create, modify, and delete users and groups and configure how Tilmeld works. It also acts as the endpoint for email address verification.

## Installation

```sh
npm install --save @nymphjs/tilmeld-setup
```

## Usage

You need to setup a Nymph REST endpoint, then you can use the Tilmeld Setup App as another endpoint in your Express server.

IMPORTANT: Within the setup app, Tilmeld **does not** check for XSRF tokens, so **do not** put your REST endpoint under the setup app's path, or you will be vulnerable to XSRF attacks!

For this example, I'll use the SQLite3 driver with an in-memory database.

```ts
import express from 'express';
import SQLite3Driver from '@nymphjs/driver-sqlite3';
import { Nymph } from '@nymphjs/nymph';
import { Tilmeld } from '@nymphjs/tilmeld';
import createServer from '@nymphjs/server';
import setup from '@nymphjs/tilmeld-setup';

// Import all the entities you will be using on the server.
import './entities/MyEntity';

// Configure Nymph.
const nymph = new Nymph(
  {},
  new SQLite3Driver({
    filename: ':memory:',
  }),
  new Tilmeld({
    appName: 'My App',
    appUrl: 'http://localhost',
    cookieDomain: 'localhost',
    cookiePath: '/',
    setupPath: '/user',
    verifyRedirect: 'http://localhost',
    verifyChangeRedirect: 'http://localhost',
    cancelChangeRedirect: 'http://localhost',
    jwtSecret: 'shhhhh',
  }),
);

// Create your Express app.
const app = express();

// Use the REST server.
app.use('/rest', createServer(nymph));

// Create Tilmeld setup app.
app.use(
  '/user',
  setup(
    {
      restUrl: 'http://localhost/rest',
    },
    nymph,
  ),
);

// Do anything else you need to do...

// Start your server.
app.listen(80);
```

# License

Copyright 2021-2025 SciActive Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
npm package: @nymproject/contract-clients
Description: This package contains read-only query and signing clients for all Nym's smart contracts.
Author: Nym Technologies SA
Latest version: 1.4.1

# Nym Smart Contract Clients

This package contains read-only query and signing clients for all Nym's smart contracts.

## Usage

First install the package and its dependencies from Cosmos Stargate:

```
npm install @nymproject/contract-clients @cosmjs/cosmwasm-stargate @cosmjs/proto-signing
```

Then execute some methods, signing them with a mnemonic:

```ts
import { contracts } from '@nymproject/contract-clients';
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";

async function main() {
  // generate a signer from a mnemonic
  const signer = await DirectSecp256k1HdWallet.fromMnemonic("...");
  const accounts = await signer.getAccounts();

  // make a signing client for the Nym Mixnet contract on mainnet
  const cosmWasmSigningClient = await SigningCosmWasmClient.connectWithSigner("https://rpc.nymtech.net:443", signer);
  const client = new contracts.Mixnet.MixnetClient(cosmWasmSigningClient, accounts[0].address, 'n17srjznxl9dvzdkpwpw24gg668wc73val88a6m5ajg6ankwvz9wtst0cznr');

  // delegate 1 NYM to mixnode with id 100
  const result = await client.delegateToMixnode({ mixId: 100 }, 'auto', undefined, [{ amount: `${1_000_000}`, denom: 'unym' }]);

  console.log(`Tx Hash = ${result.transactionHash}`);
}
```
npm package: @nymproject/mix-fetch
Description: This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.
Author: Nym Technologies SA
Latest version: 1.4.4

# Nym MixFetch

This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.

## Usage

Use `mixFetch` in your own project with:

```js
import { mixFetch } from '@nymproject/mix-fetch';

...

const response = await mixFetch('https://nymtech.net');
const html = await response.text();
```
npm package: @nymproject/mix-fetch-commonjs
Description: This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.
Author: Nym Technologies SA
Latest version: 1.4.4

# Nym MixFetch

This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.

## Usage

```js
const { mixFetch } = require('@nymproject/mix-fetch');

...

const response = await mixFetch('https://nymtech.net');
const html = await response.text();
```
npm package: @nymproject/mix-fetch-commonjs-full-fat
Description: This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.
Author: Nym Technologies SA
Latest version: 1.4.4

# Nym MixFetch

This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.

## Usage

```js
const { mixFetch } = require('@nymproject/mix-fetch');

...

const response = await mixFetch('https://nymtech.net');
const html = await response.text();
```
npm package: @nymproject/mix-fetch-full-fat
Description: This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.
Author: Nym Technologies SA
Latest version: 1.4.4

# Nym MixFetch

This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.

## Usage

```js
import { mixFetch } from '@nymproject/mix-fetch';

...

const response = await mixFetch('https://nymtech.net');
const html = await response.text();
```
npm package: @nymproject/mix-fetch-node-commonjs
Description: This package is a drop-in replacement for `fetch` in NodeJS to send HTTP requests over the Nym Mixnet.
Author: Nym Technologies SA
Latest version: 1.4.4

# Nym MixFetch

This package is a drop-in replacement for `fetch` in NodeJS to send HTTP requests over the Nym Mixnet.

## Usage

```js
const { mixFetch } = require('@nymproject/mix-fetch-node-commonjs');

...

const response = await mixFetch('https://nymtech.net');
const html = await response.text();
```
npm package: @nymproject/nodejs-client-commonjs
Description: This package is a NodeJS client that uses the wasm from the [Sphinx webassembly client](https://github.com/nymtech/nym/blob/4890c528bcb519290de81ef968bb2ba1399914a4/wasm/client/README.md), runs it inside a NodeJS Worker thread and allows users to send and
Author: Nym Technologies SA
Latest version: 1.4.1

# Nym NodeJS wrapper for Sphinx webassembly client

This package is a NodeJS client that uses the wasm from the [Sphinx webassembly client](https://github.com/nymtech/nym/blob/4890c528bcb519290de81ef968bb2ba1399914a4/wasm/client/README.md), runs it inside a NodeJS Worker thread and allows users to send and receive Sphinx packets to/from a Nym mixnet.

## Usage

```js
const { createNymMixnetClient } = require('@nymproject/nodejs-client-commonjs');

async () => {
  const nym = await createNymMixnetClient();

  nym.events.subscribeToTextMessageReceivedEvent(async (e) => {
    console.log("message received", e.args.payload);
  });

  const nymApiUrl = 'https://validator.nymtech.net/api/';

  // start the client and connect to a gateway
  await nym.client.start({
    nymApiUrl,
    clientId: 'my-client',
  });

  nym.events.subscribeToConnected(async (e) => {
    // send a message to yourself
    const message = 'Hello';
    const recipient = await nym.client.selfAddress();
    await nym.client.send({ payload: { message, mimeType: 'text/plain' }, recipient });
  });
};
```
npm package: @nymproject/nym-client-wasm
Description: A webassembly client which can be used to interact with the the Nym privacy platform. Wasm is used for Sphinx packet generation.
Latest version: 1.4.1

# Nym Sphinx webassembly client

Produces layer-encrypted Sphinx packets for use with Nym mixnets. 

[Sphinx](http://www0.cs.ucl.ac.uk/staff/G.Danezis/papers/sphinx-eprint.pdf) packets ensure the privacy of information in transit, even when the adversary is able to monitor the network in its entirety. When used with a mixnet, both content (what you said) and metadata (who you said it to, when you said it) are protected.

This helps browser-based and mobile applications get stronger privacy, in a way that wasn't previously possible.

This client is part of the [Nym](https://nymtech.net/docs) project. It's written in Rust and compiled to WebAssembly.

## Security Status 

From a security point of view, this module is not yet complete. Key missing features include, but are not limited to: cover traffic, sending packets with delay according to Poisson distribution. 

They should be implemented soon. You can build your applications, but don't rely on it for strong anonymity yet if your application needs cover traffic.

## Using it

See the [SDK directory](../../sdk/typescript/examples) for examples on how to use it and the NPM packages available.

## Developing

Make sure you have `wasm-pack` installed (`cargo install wasm-pack`) before you start.

Please use the [Makefile](Makefile) targets to build this crate and compile it to WASM:

```
make build
```

The outputs will be found [here](../../dist/wasm/client) where it will be accessible to the rest of the monorepo using workspaces.

### Packaging

> **TODO**

If you're a Nym platform developer who's made changes to the Rust files and wants to re-publish the package to NPM, here's how you do it: 

1. bump version numbers as necessary for SemVer
2. go the `sdk/typescript` directory (off the project root)
3. run:
```
yarn
yarn build
yarn publish
```
npm package: @nymproject/nym-client-wasm-node
Description: A webassembly client which can be used to interact with the the Nym privacy platform. Wasm is used for Sphinx packet generation.
Latest version: 1.4.1

# Nym Sphinx webassembly client

Produces layer-encrypted Sphinx packets for use with Nym mixnets. 

[Sphinx](http://www0.cs.ucl.ac.uk/staff/G.Danezis/papers/sphinx-eprint.pdf) packets ensure the privacy of information in transit, even when the adversary is able to monitor the network in its entirety. When used with a mixnet, both content (what you said) and metadata (who you said it to, when you said it) are protected.

This helps browser-based and mobile applications get stronger privacy, in a way that wasn't previously possible.

This client is part of the [Nym](https://nymtech.net/docs) project. It's written in Rust and compiled to WebAssembly.

## Security Status 

From a security point of view, this module is not yet complete. Key missing features include, but are not limited to: cover traffic, sending packets with delay according to Poisson distribution. 

They should be implemented soon. You can build your applications, but don't rely on it for strong anonymity yet if your application needs cover traffic.

## Using it

See the [SDK directory](../../sdk/typescript/examples) for examples on how to use it and the NPM packages available.

## Developing

Make sure you have `wasm-pack` installed (`cargo install wasm-pack`) before you start.

Please use the [Makefile](Makefile) targets to build this crate and compile it to WASM:

```
make build
```

The outputs will be found [here](../../dist/wasm/client) where it will be accessible to the rest of the monorepo using workspaces.

### Packaging

> **TODO**

If you're a Nym platform developer who's made changes to the Rust files and wants to re-publish the package to NPM, here's how you do it: 

1. bump version numbers as necessary for SemVer
2. go the `sdk/typescript` directory (off the project root)
3. run:
```
yarn
yarn build
yarn publish
```
npm package: @nymproject/nym-validator-client
Description: A TypeScript client for interacting with smart contracts in Nym validators
Author: Nym Technologies SA
Latest version: 0.18.0

Nym Validator Client
====================

A TypeScript client for interacting with CosmWasm smart contracts in Nym validators. 

Running examples
-----------------

With the code checked out, `cd examples`. This folder contains runnable example code that will set up a blockchain and allow you to interact with it through the client. 

Running tests
-------------

```
npm test
```

You can also trigger test execution with a test watcher. I don't have the centuries of life left to me that are needed to fight through the arcana of wiring up a working TypeScript mocha triggered execution setup, so for now my Cargo-based hack is:


```
cargo watch -s "cd clients/validator && npm test"
```

It's ugly but works fine if you have Cargo installed. TypeScript setup help happily accepted here. 

Generating Documentation
------------------------

You can generate docs by running `npm run docs`. Generated output will appear in the `docs` directory. 

Packaging
------------------------

If you're a Nym platform developer who's made changes to the client and wants to re-publish the package to NPM, here's how you do it: 

1. Bump the version number (use SemVer)
1. `npm run build`
1. `npm login` (if you haven't already)
1. `npm publish`
npm package: @nymproject/sdk
Description: The Nym SDK for Typescript will get you creating apps that can use the Nym Mixnet and Coconut credentials quickly.
Author: Nym Technologies SA
Latest version: 1.4.1

# Nym SDK (Typescript)

The Nym SDK for Typescript will get you creating apps that can use the Nym Mixnet and Coconut credentials quickly.

## TL;DR

Include the SDK in your project:

```
npm install @nymproject/sdk
```

Open a connection to a Gateway on the Nym Mixnet:

```ts
import { createNymMixnetClient } from '@nymproject/sdk';

const main = async () => {
  const nym = await createNymMixnetClient();

  const nymApiUrl = 'https://validator.nymtech.net/api';

  // show message payload content when received 
  nym.events.subscribeToTextMessageReceivedEvent((e) => {
    console.log('Got a message: ', e.args.payload);
  });

  // start the client and connect to a gateway
  await nym.client.start({
    clientId: 'My awesome client',
    nymApiUrl,
  });

  // send a message to yourself
  const payload = 'Hello mixnet';
  const recipient = nym.client.selfAddress();
  nym.client.send({ payload, recipient });
  
};
```

This will start the WASM client on a worker thread, so that your code can stay nice and snappy.

Send a message to another user (you will need to know their address at a Gateway):

```ts
  const payload = 'Hello mixnet';
  const recipient = '<< RECIPIENT ADDRESS GOES HERE >>';
  await nym.client.send({ payload, recipient });
```

## Find the right package for you

Browsers:
- **`ESM` 🥛** - [@nymproject/sdk](https://www.npmjs.com/package/@nymproject/sdk), not bundled, use `import` syntax, you will need to bundle it
- **`ESM` 🥛🥛🥛** - [@nymproject/sdk-full-fat](https://www.npmjs.com/package/@nymproject/sdk-full-fat), use `import` syntax, pre-bundled with inlined workers and WASM bundles 
- **`CJS` 🥛** - [@nymproject/sdk](https://www.npmjs.com/package/@nymproject/sdk-commonjs), targets ES5, not bundled, you will need to bundle it
- **`CJS` 🥛🥛🥛** - [@nymproject/sdk-full-fat](https://www.npmjs.com/package/@nymproject/sdk-commonjs-full-fat), targets ES5, pre-bundled with inlined workers and WASM bundles

NodeJS:
- **`ESM`** - [@nymproject/sdk-nodejs](https://www.npmjs.com/package/@nymproject/sdk-nodejs), use `import` syntax in NodeJS 18 and later 
- **`CJS`** - [@nymproject/sdk-nodejs-cjs](https://www.npmjs.com/package/@nymproject/sdk-nodejs-cjs), use `require` syntax in older NodeJS versions

Why have all these variations? Each project is different, so hopefully we have something for you!

Choose a package depending on how your project is transpiled and packaged:

- `ESM`: use `import` syntax and have your bundler copy the WASM bundles into your output distribution
- `CJS`: you have an older project that needs ES5 Javascript
- `nodejs`: you want to write your project server-side or locally without the browser on NodeJS

And then, to use `*-full-fat` or not, how do I choose? We have `*-full-fat` packages that are pre-bundled by including all web-workers and WASM as inline Base64.

Use the `*-full-fat` packages when you have trouble changing your bundler settings, or you can use an open CSP.