Skip to main content

Integration Huawei B2C

Description

The <clevergy-integration-huawei-b2c> component allows end-users to directly connect their Huawei solar installations through their personal FusionSolar credentials using OAuth authentication. This microfrontend can be embedded in any client's website.

Integration Flow

  1. Process Initiation: The user clicks a button on the website or app where the microfrontend is embedded.

  2. FusionSolar Redirect: The user is redirected to the FusionSolar website where they securely enter their credentials (username and password). Note: The user must have the 'owner' role in FusionSolar.

  3. Permissions Screen: After entering credentials, a screen appears requesting permissions to receive energy data and control the inverter.

  4. Callback URL: After accepting permissions, the user is redirected to the configured callback URL. We recommend this URL to be either a connections screen within your app/website or the main page where the user can view their energy data.

Callback URL Configuration

The callback URL is where users will be redirected after completing the Huawei FusionSolar connection process. You can configure this to:

  • A connection confirmation page
  • A dashboard showing production data
  • Any other relevant page in your application

Delegate Mode

  • Functionality: By default, the delegate parameter is set to false, causing the microfrontend to directly redirect to the FusionSolar website. However, if delegate is set to true, the microfrontend emits an event containing the FusionSolar URL. This allows developers to subscribe to the event and handle the redirection in a custom manner, such as opening an in-app browser if used in a mobile app.

  • Mobile Apps Usage: This is particularly useful in mobile apps, especially on iOS where OAuth redirects and deeplinks can fail when third-party browsers like Chrome are used instead of Safari. The OAuth authorization flow might complete successfully, but the callback redirect may not properly return to the app. Using delegate allows developers to manage the entire authentication process within an in-app WebView, ensuring reliable redirects and a seamless user experience.

Technical Documentation

Check out the full documentation for clevergy-integration-huawei-b2c.