Downloading and initializing the SDK
Add a container for CSPR.click UI
<body>
<div id="csprclick-ui-wrapper"> <!-- CSPR.click UI container -->
<div id="csprclick-ui"></div>
</div>
<div id="root">
<!-- your application goes here -->
</div>Define the initialization options
import type { ClickUIOptions } from '@make-software/csprclick-core-types/clickui';
import type { CsprClickInitOptions } from '@make-software/csprclick-core-types';
import { CONTENT_MODE, WALLET_KEYS } from '@make-software/csprclick-core-types';
declare global {
interface Window {
clickUIOptions: ClickUIOptions;
clickSDKOptions: CsprClickInitOptions;
}
}
const clickUIOptions: ClickUIOptions = {
uiContainer: 'csprclick-ui',
rootAppElement: '#root',
defaultTheme: 'light',
accountMenuItems: [
'AccountCardMenuItem',
'CopyHashMenuItem',
'BuyCSPRMenuItem',
],
};
window.clickUIOptions = clickUIOptions;
const clickSDKOptions: CsprClickInitOptions = {
appName: 'CSPR.click demo',
appId: 'csprclick-template',
contentMode: CONTENT_MODE.IFRAME,
providers: [
WALLET_KEYS.CASPER_WALLET,
WALLET_KEYS.LEDGER,
WALLET_KEYS.METAMASK_SNAP,
],
};
window.clickSDKOptions = clickSDKOptions;Download the runtime library
What's next
Last updated

