PocketBaseSharp 1.1.0

dotnet add package PocketBaseSharp --version 1.1.0
                    
NuGet\Install-Package PocketBaseSharp -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PocketBaseSharp" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PocketBaseSharp" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="PocketBaseSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PocketBaseSharp --version 1.1.0
                    
#r "nuget: PocketBaseSharp, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PocketBaseSharp@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PocketBaseSharp&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=PocketBaseSharp&version=1.1.0
                    
Install as a Cake Tool

<div style="display: flex; align-items: center; gap: 10px; flex-wrap: wrap;"> <img src="https://i.imgur.com/ZVBiUo5.png" alt="PBSharp" width="150"/> <img src="https://img.shields.io/badge/pocketbase-%23b8dbe4.svg?style=for-the-badge&logo=Pocketbase&logoColor=black" alt="PocketBase"/> <img src="https://img.shields.io/badge/built%20with-Blazor-purple?style=for-the-badge&logo=dotnet&logoColor=white" alt="Blazor"/> <img src="https://img.shields.io/badge/MudBlazor-%231e88e5.svg?style=for-the-badge&logo=mudblazor&logoColor=white" alt="MudBlazor"/> </div>

PocketBaseSharp

Community-developed, open-source C# SDK for PocketBase — the lightweight, real-time backend for your apps.

Features

  • Authentication (user/admin)
  • Real-time subscriptions
  • Batch operations (create/update/delete)
  • File uploads/downloads
  • Backup Management (create, download, restore, delete backups) (NEW)
  • Blazor & .NET 10 compatible
  • Mudblazor demo Blazor WASM app with admin dashboard (NEW)
  • Pocketbase v0.28.4

Acknowledgments

Special thanks to PRCV1 for creating the original PocketBase C# SDK and laying the groundwork for this project. His excellent work made this continuation possible.

This fork exists with his approval.

Installation

Structure:

  • Example (Blazor demo site)
  • PocketBaseSharp (The SDK)
  • PocketBaseSharp.Tests
  • PocketBase (Database & windows binary)

Running the demo project:

  • Set example.csproj as startup project
  • Open \PocketBase\pocketbase.exe in terminal and run the following command to start the PocketBase instance: pocketbase.exe serve
  • Visit http://127.0.0.1:8090/_/ to access the database directly

Pocketbase admin login: Email: admin@admin.com PW: demo123456

Example blazor demo login (User): Email: admin@admin.com PW: demo1234

Example blazor admin dashboard: Access the admin dashboard at /admin/login with: Email: admin@admin.com PW: demo123456 (PocketBase admin password)

The admin dashboard includes:

  • Admin authentication
  • Database backup management (create, download, restore, delete)

example/wwwroot/appsettings.json to change PocketBase instance address.

Using the SDK:

  • Add PocketSharpSDK to your solution
  • Add PocketSharpSDK to your project as a reference
  • Nuget package coming in the future

Getting Started

using PocketBaseSharp;

Create a new client which connects to your PocketBase API

var client = new PocketBase("http://127.0.0.1:8090");

Authenticate as an Admin

var admin = await client.Admin.AuthWithPasswordAsync("admin@admin.com", "demo123456");

Or as a User

var user = await client.User.AuthWithPasswordAsync("admin@admin.com", "demo1234");

Query some data (for example, some ToDo items) Note: Each CRUD action requires a data type which inherits from the base class 'BaseModel'.

var restaurantList = await client.Collection("todos").GetFullListAsync<todos>();

Manage backups (Admin only)

// Create a new backup
var result = await client.Backup.CreateAsync("my-backup.zip");

// List all backups
var backups = await client.Backup.GetFullListAsync();

// Download a backup
var stream = await client.Backup.DownloadAsync("my-backup.zip");

// Restore from backup (⚠️ Destructive - replaces current database)
await client.Backup.RestoreAsync("my-backup.zip");
(not functional when pocketbase is hosted by windows. Will work with Linux though.

// Delete a backup
await client.Backup.DeleteAsync("my-backup.zip");

Development

Requirements

  • .NET 10

Contributing

Contributions are welcome! Please open issues or pull requests.

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/YourFeature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/YourFeature)
  5. Open a pull request

License

MIT


This project is currently still under development. It is not recommended to use it in a production environment. Things can and will change. This also applies to PocketBase

Built with 💘 for the PocketBase community. Continued development of the original PocketBase C# SDK by PRCV1 - I can't thank you enough for your work! This project is tested with BrowserStack.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 80 1/11/2026

Version 1.1.0: Added backup management features (create, download, restore, delete backups). Compatible with PocketBase v0.35.1 and .NET 10.