Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md with simple example and ready() #291

Merged
merged 6 commits into from
Nov 18, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { ready, SignifyClient, Tier } from 'signify-ts';

await ready();

const bran = '0'.repeat(21);
Copy link
Contributor

@iFergal iFergal Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably use randomPasscode here, just so new users are aware Signify can generate it instead of external

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Why is it a shared secret with KERIA though? It's generated locally with libsodium

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iFergal isn't this meant to be stored OOB by the user to access/manipulate state on KERIA?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah since Signify is stateless but it's never shared with KERIA. It's just used to derive the keys locally, and those public keys/events etc are shared with KERIA.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iFergal yeah you're right, I'll remove the comment.

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
Loading