Authentication
To use Anvil tools you need to authenticate your SDK instance with a valid client API key.
The SDK uses a singleton to manage the authentication state, which means you only need to call the authenticate
function once at the start of your program.
Warning
Beware that the authenticate
function will throw an error if you pass an invalid API key.
Example
import { anvil } from "@ada-anvil/sdk-client";
try {
anvil.config.authenticate("client_XXXXXXX");
} catch {
console.log("Authentication failed");
}