Skip to content
pubscout

serverpod_client

4.1.2, released 7 days ago by serverpod.dev

Base classes for communicating with a Serverpod backend via HTTP and WebSocket

WASM-readyRock solid
$ flutter pub add serverpod_client
Source repository

What it does

Provides client-side abstractions for sending requests, receiving responses, and handling WebSocket streams to a Serverpod server. It includes serialization helpers and connection management.

AI-written summary of version 4.1.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to integrate a Flutter app with a Serverpod backend
  • You want type-safe request/response handling without custom code generation
  • You prefer a lightweight client over full-featured HTTP libraries

Skip it when

  • You need advanced HTTP features like interceptors, caching, or multipart uploads
  • You prefer a declarative networking approach with code generation

Strengths

  • Lightweight and tightly coupled to Serverpod API
  • Supports both HTTP and WebSocket communication
  • No build_runner or codegen required

Weaknesses

  • Limited to Serverpod servers only
  • No built-in support for advanced HTTP features
  • No declarative API

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
7

Add dependency to pubspec and import; no build_runner needed

import 'package:serverpod_client/serverpod_client.dart';
final client = ServerpodClient('http://localhost:8080');
await client.call('myEndpoint', {'param': 'value'});

Alternatives

Packages that do the same job and could replace serverpod_client.

  • sse

    Bidirectional Server Sent Events client and server for Dart.

  • graphql_server2

    Base package for executing GraphQL queries, mutations, and subscriptions against a schema.

  • belatuk_http_server

    Utility classes that simplify building Dart server‑side HTTP services with HttpServer.

  • modbus_client

    Base Modbus client package for sending requests via Serial and TCP/IP.

Works with

Packages commonly used together with serverpod_client: ones it builds on, ones built on it, and its own family.