Configure Aptos Keyless
Kana Widget Configuration for Aptos Keyless
Last updated
Kana Widget Configuration for Aptos Keyless
Last updated
To enable Aptos keyless functionality in the Kana Widget, follow the steps below:
Navigate to the Google Cloud Console.
Sign in with your Google account credentials.
If you don’t have an existing project, click on the “Select a project” dropdown menu at the top of the page and choose “New Project.”
Enter a name for your project and click “Create.” Detailed instructions can be found here.
Step 3: Configure Consent Screen
In the left sidebar, navigate to “APIs & Services” > “OAuth consent screen.”
Choose “External” user type and click “Create.”
Enter the required details such as the application name, user support email, and developer contact information.
Optionally, add additional details like the application logo and privacy policy URL.
Click “Save and continue.” Detailed steps are available here.
In the left sidebar, navigate to “APIs & Services” > “Credentials.”
2.Click on “Create Credentials” and select “OAuth client ID.”
Choose the application type (e.g., Web application, Desktop app, or Mobile app).
Enter the necessary details such as the name of your application and the authorized redirect URIs. For OIDC, the redirect URIs should follow the format https://your-app-domain.com.
Click “Create.”
After creating the OAuth client ID, Google will provide you with a client ID and client secret. These credentials are essential for authenticating your application.
Note down the client ID and client secret securely. Do not expose them publicly.
Integrate OIDC authentication into your application using a suitable OIDC library or framework (e.g., Passport.js for Node.js, Spring Security for Java, or Auth0 for various platforms).
Use the client ID and client secret obtained from Google to configure OIDC authentication in your application settings.
Set up the appropriate callback URL (https://your-app-domain.com) for handling authentication responses from Google.
note
import { KanaWidget, AptosDexsFilter, BridgeOption, Chain, WidgetConfig } from "@kanalabs/kana-widget-v2";
const widgetConfig: WidgetConfig= {
// Required: The unique SDK key provided by the development team. This key is essential for the widget to function properly.
// If you haven't received a key yet, please contact the development team to obtain one.
sdkKey: "Your dApp/company SDK key",
//Optional: The name of your dApp or company using this widget.
integrator:"Your dApp/company name",
// Optional: Configure custom blockchain network providers if you wish to use your own instead of default settings.
Provider: {
aptosProvider: `https://aptos-mainnet.nodereal.io/v1/${NODEREAL_KEY}/v1`,
solanaProvider: `https://greatest-frequent-owl.solana-mainnet.quiknode.pro/${SOLANA_QUICKNODE_KEY}`,
polygonProvider: `https://polygon-mainnet.nodereal.io/v1/${NODEREAL_KEY}`,
binanceProvider: `https://bsc-mainnet.nodereal.io/v1/${NODEREAL_KEY}`,
ethereumProvider: `https://eth-mainnet.nodereal.io/v1/${NODEREAL_KEY}`,
arbitrumProvider: `https://open-platform.nodereal.io/${NODEREAL_KEY}/arbitrum-nitro/`,
avalancheProvider: `https://open-platform.nodereal.io/${NODEREAL_KEY}/avalanche-c/ext/bc/C/rpc`,
zkSyncProvider: `https://open-platform.nodereal.io/${NODEREAL_KEY}/zksync`,
suiProvider: "https://sui-mainnet-rpc.nodereal.io",
},
// paymaster api key to enable paymaster
paymasterApikey: "Your Paymaster API key",
// google client_id to enable Aptos Keyless
googleClientId: "your Google client_id',
integratorFee:{
// Fee range is 0.01% to 5%
// Input should be between 1 to 500
Fee: 1,
Address:"Your Integrator Address"
}
};
export const WidgetPage = () => {
return <KanaWidget config={widgetConfig} />;
};