Configuration Parameters

Gateway Provider

The configuration parameters of the Gateway Provider vary slightly depending on the blockchain. For a full integration guide on integrating the Gateway Provider, please see UI Modal.

<GatewayProvider
  wallet={wallet}
  connection={new Connection(clusterApiUrl("mainnet-beta"), "confirmed")}
  cluster="mainnet-beta"
  gatekeeperNetwork={gatekeeperNetwork}>
</GatewayProvider>

Property

Description

Type

wallet

An object representing the user's wallet. This may be undefined if a wallet hasn't been connected to the dApp yet.

{

publicKey, signTransaction

} (see definitions below)

wallet.publicKey

The user wallet's public key.

PublicKey from @solana/web3.js

wallet.signTransaction

A function that asks the user's wallet to sign a transaction.

(transaction: Transaction) => Promise<Transaction>

where Transaction is from @solana/web3.js

gatekeeperNetwork

The address of the Gatekeeper Network for which your Civic Passes are issued. To get started you can use the address of the CAPTCHA Verification: ignREusXmGrscGNUesoU9mxfds9AiYTezUKex2PsZV6 . In the Available Networks page you can request access to the more advanced networks.

PublicKey from @solana/web3.js

connection

A Solana connection to any Solana network. The recommended commitment level is confirmed.

Connection from @solana/web3.js

cluster

The Solana network to use (i.e. devnet, mainnet-beta, testnet). This defaults to mainnet-beta, so should be set if a different connection endpoint.

string

Advanced Configuration

Broadcasting Transactions via Civic

In the default mode of operation, the transaction required to issue or refresh the Civic Pass will be signed, but not broadcasted, by Civic. The user is responsible for broadcasting the transaction, including any fees. This flow is handled transparently by the Gateway Provider, which also communicates any fees to the user via the Civic Pass modal.

Some Gatekeeper Networks support an alternative mode such as having the Civic backend broadcast the transaction. If the Gatekeeper Network you are using supports this, you can set the gatekeeperSendsTransaction property to true to turn it on.

Property

Description

Type

gatekeeperSendsTransaction

Civic will send the transaction to the blockchain on behalf of the user. Defaults to false.

true | false

forceRequireRefresh

Setting this flag forces the user to refresh their active pass when set, even if the pass is not expired. Defaults to false.

true | false

Taking responsibility for broadcasting the transaction

If the custom handleTransaction function is provided it is the responsibility of the integrator to:

  • sign and send the transaction, or

  • send the transaction based on the signature requirements of the transaction

You also have the option of extending the transaction before it is signed and sent, in order to minimize the number of separate transactions that the user is required to approve.

Property

Description

Type

handleTransaction

An optional callback function that will invoked with a partially signed transaction for the user to sign and send to the blockchain. (not available when gatekeeperSendsTransaction is set to true)

(transaction: Transaction) => Promise<void>

Last updated