Launching verification
KeyringConnect.launchExtension(config) starts the verification flow. With
the extension installed, it opens the Keyring side panel; without it, the
browser is redirected to the chrome web store, returning to the current page
afterwards.
Configuration
Every field is required:
type ExtensionSDKConfig = {
name: string; // client name shown to the user
app_url: string; // client app URL the extension communicates with
logo_url: string; // client logo shown to the user
policy_id: number; // the on-chain policy the credential is issued for
credential_config: {
chain_id: number; // chain the credential targets
wallet_address: string; // wallet the credential binds to
};
};Validation runs before the extension is contacted and throws with a message
naming any missing field. It is truthiness-based, so a policy_id of 0 is
rejected.
Example
verify.ts
import {
KeyringConnect,
type ExtensionSDKConfig,
} from "@keyringnetwork/keyring-connect-sdk";
async function startVerification(wallet: string) {
const config: ExtensionSDKConfig = {
name: "Example dApp",
app_url: window.location.origin,
logo_url: "https://example.com/logo.png",
policy_id: 7,
credential_config: {
chain_id: 1,
wallet_address: wallet,
},
};
try {
await KeyringConnect.launchExtension(config);
} catch (error) {
console.error("Keyring Connect launch failed:", error);
}
}After a successful launch, follow the flow with tracking state.
Last verified on