The SismoConnectConfiguration is the first object to understand when starting Sismo Connect integration in your application. Its main feature is to reference the appId you got from the Sismo Factorywhen you created a new Sismo Connect app. It will then enable you to request proofs from your users and verify them.
Type definitions
The SismoConnectConfiguration is an object with the following properties:
appId (required): the Sismo Connect application identifier that you have created on the Sismo Factory.
vault.impersonate (optional): by default set to null. The list of Data Sources that you want to impersonate. They will be automatically added to your developer Vault.
displayRawResponse (optional): by default set to false. If set to true, the Sismo Data Vault app will display the proof generated in a modal and will not redirect to your application once the proof is generated. It can be useful in development.
sismoApiUrl (optional): API endpoint to fetch group information.
vaultAppBaseUrl (optional): by default set to https://vault-beta.sismo.io/.
As far as the configurations are the same in the client and server packages, we highly recommend having a common config located in a separate file (sismo-connect-config.ts for example) if you have a mono repo. You can easily import the configuration in your front end and back end from this file.
In your React application, the most basic Sismo Connect Config looks like this:
import { SismoConnectConfig, SismoConnectButton } from"@sismo-core/sismo-connect-react";constconfig:SismoConnectConfig= {// you will need to get an appId from the Factory appId:"0xf4977993e52606cfd67b7a1cde717069",}<SismoConnectButton// configconfig={config}// Sismo Connect Request Data// request proof of Data Sources ownership (e.g EVM, GitHub, Twitter or Telegram)auths={[{ authType:AuthType.GITHUB }]}// request proof of Data Group memberships of source// (e.g part of NFT owners, Dao Participants, GitHub commiters)claims={[{groupId:ENS_DAO_VOTERS_GROUP_ID}]}// request message signature from users.signature={{message:"I vote Yes to Privacy"}}onResponseBytes={(response:string) => {// call your contract/backend with the response as bytes }/>
In your front-end application, the most basic Sismo Connect Config looks like this:
import { SismoConnectConfig, SismoConnect } from"@sismo-core/sismo-connect-client";constconfig:SismoConnectConfig= {// you will need to get an appId from the Factory appId:"0xf4977993e52606cfd67b7a1cde717069",}constsismoConnect=SismoConnect({config});
In your node.js backend, the most basic Sismo Connect Config looks like this:
import { SismoConnectConfig, SismoConnect } from"@sismo-core/sismo-connect-server";constconfig:SismoConnectConfig= {// you will need to get an appId from the Factory appId:"0xf4977993e52606cfd67b7a1cde717069",}constsismoConnect=SismoConnect({config});
In your smart contract, the most basic Sismo Connect Config looks like this:
Impersonating accounts allows you to be redirected to a Sismo Data Vault app with fake accounts imported that you defined in the SismoConnectConfig object. The impersonated Vault only exists in your browser memory. It does not affect your personal Data Vault.
It is useful in development to test your application flow. You are able to generate a proof based on a Sismo Connect request for which you would not be eligible otherwise.
Impersonation should not be used in production.
In your React application, the impersonation Sismo Connect Config looks like this:
import { SismoConnectConfig, SismoConnectButton } from"@sismo-core/sismo-connect-react";constconfig:SismoConnectConfig= {// you will need to get an appId from the Factory appId:"0xf4977993e52606cfd67b7a1cde717069", vault: {// For development purposes insert the identifier that you want to impersonate here// Never use this in production impersonate: ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","github:leosayous21","twitter:dhadrien_:2390703980", ] }}<SismoConnectButtonconfig={config}// Sismo Connect Request// request proof of Data Sources ownership (e.g EVM, GitHub, Twitter or Telegram)auths={[{ authType:AuthType.GITHUB }]}// request proof of Data Group memberships of source// (e.g part of NFT owners, Dao Participants, GitHub commiters)claims={[{groupId:ENS_DAO_VOTERS_GROUP_ID}]}// request message signature from users.signature={{message:"I vote Yes to Privacy"}}onResponseBytes={(response:string) => {// call your contract with the response as bytes }/>
In your front-end application, the impersonation Sismo Connect Config looks like this:
import { SismoConnectConfig, SismoConnect } from"@sismo-core/sismo-connect-client";constconfig:SismoConnectConfig= {// you will need to get an appId from the Factory appId:"0xf4977993e52606cfd67b7a1cde717069", vault: {// For development purposes insert the identifier that you want to impersonate here// Never use this in production impersonate: ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","github:leosayous21","twitter:dhadrien_:2390703980", ] }}constsismoConnect=SismoConnect({config});
In your node.js backend, the impersonation Sismo Connect Config looks like this:
import { SismoConnectConfig, SismoConnect } from"@sismo-core/sismo-connect-server";constconfig:SismoConnectConfig= {// you will need to get an appId from the Factory appId:"0xf4977993e52606cfd67b7a1cde717069", vault: {// For development purposes insert the identifier that you want to impersonate here// Never use this in production impersonate: ["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","github:leosayous21","twitter:dhadrien_:2390703980", ] }}constsismoConnect=SismoConnect({config});
In your smart contract, the most basic Sismo Connect Config looks like this: