open-index/open-npm huggingface dataset:
npm package: @matrix-org/matrix-sdk-crypto-js
Description: Matrix encryption library, for JavaScript
Latest version: 0.1.4

# `matrix-sdk-crypto-js`

Welcome to the [WebAssembly] + JavaScript binding for the Rust
[`matrix-sdk-crypto`] library! WebAssembly can run anywhere, but these
bindings are designed to run on a JavaScript host. These bindings are
part of the [`matrix-rust-sdk`] project, which is a library
implementation of a [Matrix] client-server.

`matrix-sdk-crypto` is a no-network-IO implementation of a state
machine, named `OlmMachine`, that handles E2EE ([End-to-End
Encryption](https://en.wikipedia.org/wiki/End-to-end_encryption)) for
[Matrix] clients.

## Usage

These WebAssembly bindings are written in [Rust]. To build them, you
need to install the Rust compiler, see [the Install Rust
Page](https://www.rust-lang.org/tools/install). Then, the workflow is
pretty classical by using [yarn](https://yarnpkg.com/), see [the Downloading and installing
Node.js and npm
Page](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) and [installing yarn](https://classic.yarnpkg.com/lang/en/docs/install).

Once the Rust compiler, Node.js and yarn are installed, you can run the
following commands:

```sh
$ yarn install
$ yarn build
$ yarn test
```

A `matrix_sdk_crypto.js`, `matrix_sdk_crypto.d.ts` and a
`matrix_sdk_crypto_bg.wasm` files should be generated in the `pkg/`
directory.

TBD

## Documentation

[The documentation can be found
online](https://matrix-org.github.io/matrix-rust-sdk/bindings/matrix-sdk-crypto-js/).

To generate the documentation locally, please run the following
command:

```sh
$ yarn doc
```

The documentation is generated in the `./docs` directory.

[WebAssembly]: https://webassembly.org/
[`matrix-sdk-crypto`]: https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto
[`matrix-rust-sdk`]: https://github.com/matrix-org/matrix-rust-sdk
[Matrix]: https://matrix.org/
[Rust]: https://www.rust-lang.org/
[npm]: https://www.npmjs.com/
npm package: @matrix-org/matrix-wysiwyg
Description: Wysiwyg composer for matrix.org using React
Author: matrix.org
Latest version: 2.37.9

# React Matrix Rich Text Editor

[![react-build](https://github.com/matrix-org/matrix-wysiwyg/actions/workflows/react-build.yml/badge.svg?branch=main)](https://github.com/matrix-org/matrix-wysiwyg/actions/workflows/react-build.yml)

The Matrix Rich Text Editor is a React library.

## TODO NPM / Usage documentation

The wysiwyg composer API is a react hook.

```tsx
const { ref, isWysiwygReady, wysiwyg } = useWysiwyg();

return (
    <div>
        <button type="button" onClick={wysiwyg.bold}>
            bold
        </button>
        <div ref={ref} contentEditable={isWysiwygReady} />
    </div>
);
```

## Contribute

### Install

#### Generate WASM bindings

The composer uses a cross-platform rust library. In order to work as intended, the WASM bindings must be generated according to the [Matrix Rich Text Editor README.md](../../README.md)

#### Yarn install

Requirements:

-   node >= 8.X
-   yarn 1.X

```sh
yarn install
```

### Dev

#### Folder structure

-   Inside the `lib` folder, the wysiwyg composer library files are located with `useWysiwyg` as en entrypoint
-   Inside the `src` folder, the demo page of the composer is located.

### Dev mode

Launch:

```sh
yarn dev
```

A dev server with hot reload is launched on `http://localhost:5173/` by default.

For more information, see [Vite](https://vitejs.dev/guide/features.html#hot-module-replacement) for more information.

### Build

[Vite](https://vitejs.dev/) is the Wysiwyg Composer builder.

To build:

```sh
yarn build
```

The builded files are located in the `dist` folder

### Testing

The tests are powered by [Vitest](https://vitest.dev/).

To run them, different options are available:

-   Classic run

```sh
yarn test
```

-   Watch mode

```sh
yarn test:watch
```

-   Code coverage

```sh
yarn coverage
```

The coverage report is located in the `coverage` folder.
npm package: @matrix-org/olm
Description: An implementation of the Double Ratchet cryptographic ratchet
Author: matrix.org
Latest version: 3.2.15

Olm
===

Note: before using any of the olm functions, you must call `Olm.init()`, and
wait for the promise to resolve, otherwise you will get errors like:
`Uncaught TypeError: Olm.Account is not a constructor`

If you get errors about failure to compile the wasm file, it is likely that Olm
is not locating the wasm file properly.  You can tell Olm where the wasm file
is by passing a `locateFile` parameter to `Olm.init()`, for example:
`Olm.init({locateFile: () => pathToWasmFile})`.

Example:

    var alice = new Olm.Account();
    var bob = new Olm.Account();
    alice.create();
    bob.create();
    bob.generate_one_time_keys(1);

    var bobs_id_keys = JSON.parse(bob.identity_keys());
    var bobs_id_key = bobs_id_keys.curve25519;
    var bobs_ot_keys = JSON.parse(bob.one_time_keys());
    for (key in bobs_ot_keys.curve25519) {
        var bobs_ot_key = bobs_ot_keys.curve25519[key];
    }

    alice_session = new Olm.Session();
    alice_session.create_outbound(alice, bobs_id_key, bobs_ot_key);
    alice_message = a_session.encrypt("Hello");

    bob_session.create_inbound(bob, bob_message);
    var plaintext = bob_session.decrypt(message_1.type, bob_message);
    bob.remove_one_time_keys(bob_session);


Group chat:

    var outbound_session = new Olm.OutboundGroupSession();
    outbound_session.create();

    // exchange these over a secure channel
    var session_id = group_session.session_id();
    var session_key = group_session.session_key();
    var message_index = group_session.message_index();

    var inbound_session = new Olm.InboundGroupSession();
    inbound_session.create(message_index, session_key);

    var ciphertext = outbound_session.encrypt("Hello");
    var plaintext = inbound_session.decrypt(ciphertext);
npm package: @matrix-org/syn2mas
Description: A tool to migrate Synapse users and sessions to the Matrix Authentication Service
Author: Matrix.org
Latest version: 0.11.0

# syn2mas -  Synapse to Matrix Authentication Service

Tool to help with the migration of a Matrix Synapse installation to the Matrix Authentication Service.

The tool has two modes of operation:

- Advisor mode: Analyses the Synapse configuration and reports on any issues that would prevent a successful migration.
- Migration mode: Performs the migration of the Synapse database into the Matrix Authentication Service database.

## Usage

Pre-migration advisor:

```sh
npx @matrix-org/syn2mas --command=advisor --synapseConfigFile homeserver.yaml
```