Skip to content

Example usage of PrivMX Endpoint methods in JavaScript/TypeScript.

License

Notifications You must be signed in to change notification settings

simplito/privmx-webendpoint-sdk-example

Repository files navigation

Web Endpoint Example

Example usage of PrivMX Endpoint methods in JavaScript/TypeScript.

Getting Started

  1. Clone Bridge CLI:

    git clone https://github.com/simplito/privmx-bridge-docker
  2. Run setup script:

    ./setup.sh

    This will fetch the necessary Docker images, create Access Keys and your first Context. After a successful setup, CLI will display all the API keys necessary for connection.

  3. Generate keys. In your terminal, generate private-public key pair for your user. The keys must be in WIF format:

    ./genKeyPair.sh
  4. Register user.

    With the keys ready, register userId - public key pair in your Context. Don't forget to replace placeholder values with the ones created earlier:

    ./cli.sh context/addUserToContext '{"contextId": "CONTEXT_ID", "userId":"USER_ID", "userPubKey":"USER_PUBLIC_KEY" }'

Setup app

  1. Fill your env constants in ./lib.ts file with variables created during the Bridge setup.
  2. Run
    npm install 
    npm run dev
  3. Open app on path displayed in your console.

Usage

This is an example app. To see the result of functions open web browser console. Code snippets are located inside ./src/threads.ts and ./src/stores.ts files.

Documentation

Full overview of this package's functions, types and example usage can be found in our documentation.

License

MIT LICENSE

About

Example usage of PrivMX Endpoint methods in JavaScript/TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published