Skip to main content

Authentication

To use Anvil tools you need to authenticate your SDK instance with a valid server 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.

Example

import { anvil } from "@ada-anvil/sdk-server";

try {
anvil.config.authenticate("YOUR_API_KEY");
} catch {
console.log("Authentication failed");
}