# Floating API

```typescript
class FloatingAPIv2 {

  constructor(config: FloatingAPIConfig);

  get tokenExpiryDate(): Dayjs;

  setLogLevel(level: LogLevel);

  getHardwareID(algorithm: HardwareIdAlgorithm = this.config.hardwareIDMethod ?? 0): string;
  
  async ping(): boolean;

  async authAddUser(user: User);

  async authChangePassword(body: ChangePasswordReq): boolean;

  async authInitialPassword(body: SetPasswordReq): boolean;

  async authLogin(body: LoginUser): LoginResponse;

  async authUsersList(): User[];

  async authUserDelete(id: number): boolean;

  async getConfig(): CloudConfig;

  async patchConfig(input: CloudConfigUpdate): boolean;

  async bundleActivate(body: BundleRequest): ActivateBundleResponse;

  async bundleDeactivate(id: number): DeactivateBundleResponse;

  async bundleOfflineActivationGenerate(body: OfflineRequestInput): GenerateOfflineRequestResponse;

  async bundleOfflineDeactivationGenerate(body: OfflineRequestInput): GenerateOfflineRequestResponse;

  async bundleOfflineActivationUpload(product: string, file: File | Blob): ActivateBundleResponse;

  async listLicenses(params?: { product?: string }): LicenseData[];

  async activateLicense(body: AddLicenseRequest): ActivateLicenseResponse;

  async getLicenseById(id: string): LicenseData;

  async deactivateLicense(id: number): boolean;

  async addLicenseConsumption(id: number, body: AddConsumptionRequest): ConsumptionResponse;

  async addFeatureConsumption(id: number, body: AddFeatureConsumptionRequest): FeatureConsumptionResponse;

  async listLicenseFeatureUsers(id: number): AllFeatureUsersResponse;

  async registerFeatureForUser(id: number, body: RegisterFeatureRequest): RegisterFeatureResponse;

  async releaseFeatureForUser(id: number, body: UnregisterFeatureRequest): boolean;

  async releaseFeatureForAllUsers(id: number, body: AllFeatureUsersRequest): FeatureReleasedAllResponse;

  async listLicenseUsers(id: number): FloatingUser[];

  async registerUserToLicense(id: number, body: RegisterRequestBody): LicenseData;

  async unregisterUserFromLicense(id: number, body: UsernameRequest): boolean;

  async unregisterAllUsersFromLicense(id: number): UnregisterAllUsersResponse;

  async borrowLicenseForUser(id: number, body: BorrowUserRequest): BorrowResponse;

  async offlineActivationGenerate(body: OfflineRequestInput): GenerateOfflineRequestResponse;

  async offlineActivationUpload(product: string, file: File | Blob): ActivateBundleResponse | ActivateLicenseResponse;

  async offlineDeactivationGenerate(body: OfflineRequestInput): GenerateOfflineRequestResponse;

  async airgapGenerateActivation(body: GenerateAirgapRequestBody): AirgapActivationCodeResponse;

  async airgapGenerateDeactivation(body: GenerateAirgapDeactivationRequestBody): AirgapDeactivationCodeResponse;

  async airgapDeactivate(body: DeactivateAirgapRequestBody): AirgapeDeactivatedResponse;

  async airgapActivate(file: File | Blob, jsonFile: File | Blob): AirgapActivatedResponse;

  async getSyncConfig(): SyncConfig;

  async setSyncMode(body: SyncEnableReq): boolean;

  async triggerSync(): boolean;
}

type FloatingAPIConfig = {
  apiPath: string,
  hardwareID?: string,
  hardwareIDMethod?: number,
  logLevel?: LogLevel,
  proxy?: AxiosProxyConfig,
  certChain: string,
  disableUserAuth?: boolean,
} & (
    {
      apiKey: string,
      sharedKey: string
    } | {
      clientID: string,
      clientSecret: string,
      tokenUrl: string
    }
  );
  
```

For declarations of types referenced here see: [**Type Declarations**](/sdks/node.js-sdk/type-declarations.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.licensespring.com/sdks/node.js-sdk/floating-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
