Skip to content

Commit

Permalink
feat: remove profileProviders
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoch committed Oct 3, 2024
1 parent 02b6132 commit f4c0337
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions apps/idos-example-dapp/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_FRACTAL_ID_URL=https://app.fractal.id/authorize?client_id=er6XdOOyU_2y8MfKM5pN_fG52l3dVQYIPXBm6Lf4UVc&redirect_uri=https%3A%2F%2Fdashboard.idos.network%2Fsuccess&response_type=code&scope=contact%3Aread%20verification.uniqueness%3Aread%20verification.uniqueness.details%3Aread%20verification.idos%3Aread%20verification.idos.details%3Aread%20verification.wallet-eth%3Aread%20verification.wallet-eth.details%3Aread
2 changes: 1 addition & 1 deletion apps/idos-example-dapp/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const connectWallet = {
terminal
.h1("pleading", `No idOS profile found for ${address}`)
.h2("Need an idOS profile?")
.log(`Get one at <a href="${idOS.profileProviders[0]}">Fractal ID</a>`)
.log(`Get one at <a href="${import.meta.env.VITE_FRACTAL_ID_URL}">Fractal ID</a>`)
.h2("Already have one?")
.log("Please connect with the right address")
.status("done", "Done");
Expand Down
8 changes: 8 additions & 0 deletions apps/idos-example-dapp/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_FRACTAL_ID_URL: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
1 change: 0 additions & 1 deletion packages/idos-sdk-js/.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ VITE_IDOS_EVM_DEFAULT_CHAIN_ID=0xaa36a7
VITE_IDOS_NEAR_DEFAULT_NETWORK=mainnet
VITE_IDOS_NEAR_DEFAULT_CONTRACT_ID=idos-dev-4.near
VITE_IDOS_NEAR_DEFAULT_RPC_URL=https://rpc.mainnet.near.org
VITE_FRACTAL_ID_URL=https://app.fractal.id/authorize?client_id=er6XdOOyU_2y8MfKM5pN_fG52l3dVQYIPXBm6Lf4UVc&redirect_uri=https%3A%2F%2Fdashboard.idos.network%2Fsuccess&response_type=code&scope=contact%3Aread%20verification.uniqueness%3Aread%20verification.uniqueness.details%3Aread%20verification.idos%3Aread%20verification.idos.details%3Aread%20verification.wallet-eth%3Aread%20verification.wallet-eth.details%3Aread
4 changes: 2 additions & 2 deletions packages/idos-sdk-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ if (humanId) {

You can also use `idos.hasProfile(signer.address)` before `setSigner` for a check that won't require a signature.

If your user does not have an idOS profile, you can send them to Fractal ID for them to get one, by redirecting them to the first URL in `idOS.profileProviders`. By using that URL, you agree to [Fractal ID's Terms of Service](https://web.fractal.id/wp-content/uploads/2023/11/Onboarding-link.pdf).
If your user does not have an idOS profile, you'll have to first redirect them to your credential provider. Here's an example:

```js
if (!idos.hasProfile(signer.address))
window.location = idOS.profileProviders[0];
window.location = "https://kyc-provider.example.com/enroll";
```

### Credentials
Expand Down
1 change: 0 additions & 1 deletion packages/idos-sdk-js/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ interface ImportMetaEnv {
readonly VITE_IDOS_NEAR_DEFAULT_NETWORK: string;
readonly VITE_IDOS_NEAR_DEFAULT_CONTRACT_ID: string;
readonly VITE_IDOS_NEAR_DEFAULT_RPC_URL: string;
readonly VITE_FRACTAL_ID_URL: string;
}
2 changes: 0 additions & 2 deletions packages/idos-sdk-js/src/lib/idos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export class idOS {
static evm = Grants.evm;
static kwil = KwilWrapper.defaults;

static profileProviders = [import.meta.env.VITE_FRACTAL_ID_URL];

static verifiableCredentials = verifiableCredentials;

auth: Auth;
Expand Down
1 change: 0 additions & 1 deletion packages/idos-sdk-server-dapp/.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ VITE_IDOS_EVM_DEFAULT_CHAIN_ID=0xaa36a7
VITE_IDOS_NEAR_DEFAULT_NETWORK=mainnet
VITE_IDOS_NEAR_DEFAULT_CONTRACT_ID=idos-dev-4.near
VITE_IDOS_NEAR_DEFAULT_RPC_URL=https://rpc.mainnet.near.org
VITE_FRACTAL_ID_URL=https://app.fractal.id/authorize?client_id=er6XdOOyU_2y8MfKM5pN_fG52l3dVQYIPXBm6Lf4UVc&redirect_uri=https%3A%2F%2Fdashboard.idos.network%2Fsuccess&response_type=code&scope=contact%3Aread%20verification.uniqueness%3Aread%20verification.uniqueness.details%3Aread%20verification.idos%3Aread%20verification.idos.details%3Aread%20verification.wallet-eth%3Aread%20verification.wallet-eth.details%3Aread

0 comments on commit f4c0337

Please sign in to comment.