Skip to content

Commit

Permalink
Update README.md with simple example and ready() (#291)
Browse files Browse the repository at this point in the history
* Update README.md with simple example and ready()

Added simple code example to get started and a  note about calling the ready() function for the library to be usable.

* Prettier formatting fixes to README

* Update README.md with randomPasscode

randomPasscode added to example to make new users aware.

* Update README.md

removed erroneous comment.
  • Loading branch information
daidoji authored Nov 18, 2024
1 parent c13b6e8 commit 2bf0df1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,31 @@ The code is built using Typescript and running code locally requires a Mac or Li
Typescript source files needs to be transpiled before running scripts or integration tests

- Build:

```bash
npm run build
```

- ready() must be called before library is useable. Example minimum viable client code.

```javascript
import { randomPasscode, ready, SignifyClient, Tier } from 'signify-ts';
await ready();
const bran = randomPasscode();
const url = 'http://127.0.0.1:3901';
const boot_url = 'http://127.0.0.1:3903';
const actualSignifyClient = new SignifyClient(
url,
bran,
Tier.low,
boot_url
);
console.log(actualSignifyClient);
```
### Unit testing
To run unit tests
Expand Down

0 comments on commit 2bf0df1

Please sign in to comment.