Authentication

Authentication for the ChainKit SDK

Per-Client Security Schemes

This SDK supports the following security scheme globally:

NameTypeScheme
apiKeyapiKeyAPI key

The ChainKit SDK can be used without an API key, but rate limits will be lower. Adding an API key allows for higher rate limits. API key authentication is deprecated, and all API keys will stop working on January 15, 2027. API key creation is disabled. Until then, existing API keys keep working, and you can view or revoke them in the Builder Console. Whether or not you use an API key, you can still interact with the SDK effectively, but the API key provides performance benefits for higher request volumes.

import { Avalanche } from "@avalanche-sdk/chainkit";

const avalancheSDK = new Avalanche({
  apiKey: "<YOUR_API_KEY_HERE>",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avalancheSDK.metrics.healthCheck();

  // Handle the result
  console.log(result);
}

run();

Warning

Never hardcode your API key directly into your code. Instead, securely store it and retrieve it from an environment variable, a secrets manager, or a dedicated configuration storage mechanism. This ensures that sensitive information remains protected and is not exposed in version control or publicly accessible code.

Is this guide helpful?

On this page

Page Actions

Edit on GitHubReport Issue