SDK Initialization
import { initKorSDK } from '@kor_protocol/core-sdk';
const apiKey = 'your-api-key';
const rpcUrl = 'https://your-rpc-url';
const origin = 'sandbox-origin-url';
const recaptchaToken = 'your-recaptcha-token'; //optional
const korSDK = initKorSDK(apiKey, {rpcUrl, chain, origin});<ReCAPTCHA
sitekey={recaptchaValue}
size="invisible"
ref={reCaptchaRef}
className="recaptcha"
/>
<button
onClick={async () => {
try {
let token: string | undefined | null = undefined;
if (reCaptchaRef.current) {
token = await reCaptchaRef.current.executeAsync();
reCaptchaRef.current.reset();
}
await initKorSDK(value, {
chain: 84532,
rpc: 'your-rpc-url',
origin: 'https://dq9c2zl6kih9v.cloudfront.net/kor-sdk-api',
recaptchaToken: token,
});
} catch (error) {
console.error(error);
}
}}
type="button"
className="btn btn-primary my-2"
>
Submit
</button>
Last updated
Was this helpful?