Skip to content

Commit

Permalink
Add a usage example to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tjconcept committed Oct 22, 2024
1 parent 2ceae83 commit 38634ca
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
A set of functions for converting to and from JSON compatible structures, useful
for passing these values between clients and servers as JSON strings.

## Example

```js
import {
parseCreationOptionsFromJSON,
attestationToJSON,
} from 'https://esm.sh/gh/tjconcept/[email protected]'

function signUp() {
const credential = navigator.credentials.create({
publicKey: parseCreationOptionsFromJSON(JSON.parse(serverWebauthnCreate())),
})
join(credential, (credential) =>
serverWebauthnStore(JSON.stringify(attestationToJSON(credential))),
)
}
```

## Exports

```
Expand Down

0 comments on commit 38634ca

Please sign in to comment.