Example usage of PrivMX Endpoint methods in JavaScript/TypeScript.
This project is deprecated, please refer to Web Endpoint if you're interested in web projects.
-
Clone Bridge CLI:
git clone https://github.com/simplito/privmx-bridge-docker
-
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.
-
Generate keys. In your terminal, generate private-public key pair for your user. The keys must be in WIF format:
./genKeyPair.sh
-
Register user.
With the keys ready, register
userId
- public key pair in your Context. Remember to replace placeholder values with the ones created earlier:./cli.sh context/addUserToContext '{"contextId": "CONTEXT_ID", "userId":"USER_ID", "userPubKey":"USER_PUBLIC_KEY" }'
- Copy or rename
.env.example
to.env
and fill with variables created during the Bridge setup. - Run
npm install npm run dev
- Open app on a path displayed in your console.
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.
Full overview of this package's functions, types and example usage can be found in our documentation.
MIT LICENSE