Skip to content

Initialization

OnCloud edited this page Dec 10, 2024 · 2 revisions

Before making API calls, initialize the client with the required configuration:

import { VirtFusionV1 } from "virtfusion";

const virtfusion = new VirtFusionV1();

const VIRTFUSION_API_HOST = "vf.example.com"; // Hostname of the VirtFusion API server
const VIRTFUSION_API_KEY = "****" // Your API key

virtfusion.init({
  host: VIRTFUSION_API_HOST,
  token: VIRTFUSION_API_KEY,
  useHttps: true,
});
Clone this wiki locally