Skip to main content

Installation

Get started with the Growatt API Rust SDK by adding it to your Rust project.

Prerequisites

  • Rust 2021 edition or later
  • An async runtime (tokio)
  • A Growatt account with valid credentials

Using Cargo

cargo add growatt
The SDK requires an async runtime. We recommend tokio with the full feature set for the best experience.

Core Dependencies

The Growatt SDK automatically includes these dependencies:
  • reqwest - HTTP client with JSON and cookie support
  • tokio - Async runtime
  • serde - Serialization framework
  • serde_json - JSON parsing
  • chrono - Date and time handling
  • thiserror - Error handling

Optional Dependencies

Environment Variable Configuration

For environment-based configuration, add:
[dependencies]
growatt = "0.1.0"
dotenv = "0.15.0"
This allows you to use .env files for credentials:
.env
GROWATT_USERNAME=your_username
GROWATT_PASSWORD=your_password
GROWATT_SESSION_DURATION=30

Verify Installation

Create a simple test file to verify the installation:
src/main.rs
use growatt::Growatt;

#[tokio::main]
async fn main() {
    let client = Growatt::new();
    println!("Growatt client created successfully!");
}
Run the test:
cargo run
You should see:
Growatt client created successfully!

Version Compatibility

Growatt SDKRust EditionTokioReqwest
0.1.020211.x0.11
The SDK uses Rust 2021 edition features. Make sure your Cargo.toml specifies edition = "2021" or later.

Next Steps

Quick Start Guide

Learn how to authenticate and make your first API call

Build docs developers (and LLMs) love