Skip to content

Commit

Permalink
add agg verifier code
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbaz17 committed Nov 27, 2024
1 parent cad3d35 commit f3282bf
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
34 changes: 33 additions & 1 deletion docs/sdk/sfa/sfa-js/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ On unsuccessful login, this function will return a `null` value.

| Parameter | Description |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `verifier` | Details of the verifier (verifier type, ie. `torus`, `metamask`, `auth` etc.). It's a `string` mandatory parameter. |
| `verifier` | Name of the verifier. It's a `string` mandatory parameter. |
| `idToken` | A newly created `JWT Token` that has not already been sent to Web3Auth or a `Duplicate Token` error will be thrown. It's a `string` mandatory parameter. |

</TabItem>
Expand All @@ -90,6 +90,16 @@ export interface TorusSubVerifierInfo {

#### Usage

<Tabs
defaultValue="single"
values={[
{ label: "Single Verifier", value: "single" },
{ label: "Aggregate Verifier", value: "aggregate" },
]}
>

<TabItem value="single">

```js
await web3auth.connect({
verifier: "verifier-name", // e.g. `web3auth-sfa-verifier` replace with your verifier name, and it has to be on the same network passed in init().
Expand All @@ -98,6 +108,28 @@ await web3auth.connect({
});
```

</TabItem>

<TabItem value="aggregate">

```js
await web3auth.connect({
verifier: "aggregate-verifier-name", // e.g. `web3auth-aggregate-verifier` replace with your verifier name, and it has to be on the same network passed in init().
verifierId: "verifier-id-value", // e.g. `Yux1873xnibdui` or `[email protected]` replace with your verifier id(sub or email)'s value.
idToken: "JWT Token", // replace with your newly created unused JWT Token.
subVerifierInfoArray: [
{
verifier: "sub-verifier-name", // e.g. `google`
idToken: "JWT Token", // replace with your newly created unused JWT Token.
},
],
});
```

</TabItem>

</Tabs>

## Get a native provider

`provider()`
Expand Down
2 changes: 1 addition & 1 deletion src/common/sdk/sfa/_sfa_login_params.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Tabs from "@theme/Tabs";

| Parameter | Description |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `verifier` | Details of the verifier. It's a mandatory parameter as a string. |
| `verifier` | Name of the verifier. It's a mandatory parameter as a string. |
| `verifierId` | Verifier ID's value, `sub` or `email` value present in the idToken. It's a mandatory parameter as a string. |
| `idToken` | A newly created `JWT Token` that has not already been sent to Web3Auth or a `Duplicate Token` error will be thrown. It's a mandatory parameter as a string. |
| `subVerifierInfoArray?` | Sub verifier info. It's an optional parameter as a TorusSubVerifierInfo[]. |
Expand Down

0 comments on commit f3282bf

Please sign in to comment.