PinguApps.Appwrite.Realtime 2.2.0

dotnet add package PinguApps.Appwrite.Realtime --version 2.2.0
                    
NuGet\Install-Package PinguApps.Appwrite.Realtime -Version 2.2.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="PinguApps.Appwrite.Realtime" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PinguApps.Appwrite.Realtime" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="PinguApps.Appwrite.Realtime" />
                    
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 PinguApps.Appwrite.Realtime --version 2.2.0
                    
#r "nuget: PinguApps.Appwrite.Realtime, 2.2.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 PinguApps.Appwrite.Realtime@2.2.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=PinguApps.Appwrite.Realtime&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=PinguApps.Appwrite.Realtime&version=2.2.0
                    
Install as a Cake Tool

Appwrite SDK

This repository contains the source to both the Client and Server .net implimentation for Appwrite API. This is not a first party SDK, rather a third party SDK.

Client Version Client Downloads Server Version Server Downloads Realtime Version Realtime Downloads GitHub Repo stars GitHub Actions Workflow Status CodeFactor Grade

Repobeats Analytics

🚧 Work in Progress

This is a work in progress. There are 2 SDK's - one for client and another for server.

πŸ”§ Installation

It is recommended to install just the client SDK into client-side projects, and both the client and server SDK into server side projects.

Client SDK

Install-Package PinguApps.Appwrite.Client

or in the Nuget package manager, search for PinguApps.Appwrite.Client (ensure you are searching for prerelease versions)

Server SDK

Install-Package PinguApps.Appwrite.Server

or in the Nuget package manager, search for PinguApps.Appwrite.Server

πŸš€ Usage

Once the package(s) are installed, you will need to add everything to your DI container. Thankfully, there's an extension method making this simple.

DI Container

Client SDK

There are 2 extension methods for the client SDK. One intended for client side usage, and the other for server side usage. The only difference is the lifetimes used in the DI container.

For client side:

services.AddAppwriteClient("Project_Id");

For Server side:

services.AddAppwriteClientForServer("Project_Id");

This will assume that you are using Appwrite in the cloud. If you are not, then you can specify your endpoint as the second parameter, which is optional. Additionally, for finer control, you can specify your own RefitSettings as the third parameter.

Server SDK
services.AddAppwriteServer("Project_Id", "Api_Key");

This will assume that you are using Appwrite in the cloud. If you are not, then you can specify your endpoint as the second parameter, which is optional. Additionally, for finer control, you can specify your own RefitSettings as the third parameter.

Injecting

To inject the SDK, you will need to request either an IAppwriteClient or IAppwriteServer, depending on which you are working with and need.

public class App
{
    private readonly IAppwriteClient _client;
    private readonly IAppwriteServer _server;

    public App(IAppwriteClient client, IAppwriteServer server)
    {
        _client = client;
        _server = server;
    }
}

Sessions (Client only)

The Client SDK will manage sessions for you. You can set the current session with:

_client.SetSession("SessionToken");

Making Calls

Both SDK's are split up into sections, matching the Appwrite Docs.

To make a call to get the current logged in account on the client SDK, you can do this with:

var user = await _client.Account.Get();

To create an account with the Server SDK, it might look like this:

var request = new CreateAccountRequest
{
    Email = "pingu@example.com",
    Password = "MySuperSecretPassword",
    Name = "Pingu"
};

var user = await _server.Account.Create(request);

Handling the result

The result object is made up of a Result property, as well as some bool's to assist in determining the success or failure. The Result Property will be one of 3 different types, depending on what happened.

All following examples will be based on the following preceeding them:

var userResponse = await _client.Account.Get();

We can determine if the call we made was successful or not by checking userResponse.Success. If this is true, the Result will be an object of the type returned from the API, in this case it will be of type User.

If userResponse.Success is false, then userResponse.IsError will be true (which we could also use to check the inverse).

If we have errored, then there might be 2 sources for the error. One would be Appwrite throwing an error, and the other would be internal - within the SDK. This could be a bug with the SDK, or invalid input provided to it.

If userResponse.IsAppwriteError is true, then Result will be of type AppwriteError.

If userResponse.IsInternalError is true, then Result will be of type InternalError.

We can switch on the result type, allowing us to perform different logic based on the success status.

userResponse.Result.Switch(
    account => Console.WriteLine(account.Email),
    appwriteError => Console.WriteLine(appwriteError.Message),
    internalError => Console.WriteLine(internalError.Message)
);

We can also pull out the known type of the response:

if(userResponse.Success)
{
    var email = userResponse.Result.AsT0.Email;
}

Finally, we can return something different depending on what type it is:

string emailAddressOrErrorMessage = userResponse.Result.Match(
    account => account.Email,
    appwriteError => appwriteError.Message,
    internalError => internalError.Message
);

βŒ› Progress

Server & Client - 172 / 317

Server - 107 / 224

Client - 65 / 93

πŸ”‘ Key

Icon Definition
βœ… The endpoint is implemented for the given SDK type (client or server)
⬛ The endpoint is not yet implemented for the given SDK type (client or server), but will be
❌ There is currently no intention to implement the endpoint for the given SDK type (client or server)

Account

Account - 58 / 58

Endpoint Client Server
Get Account βœ… ❌
Create Account βœ… βœ…
Update Email βœ… ❌
List Identities βœ… ❌
Delete Identity βœ… ❌
Create JWT βœ… ❌
List Logs βœ… ❌
Update MFA βœ… ❌
Add Authenticator βœ… ❌
Verify Authenticator βœ… ❌
Delete Authenticator βœ… ❌
Create 2FA Challenge βœ… ❌
Create MFA Challenge (confirmation) βœ… ❌
List Factors βœ… ❌
Get MFA Recovery Codes βœ… ❌
Create MFA Recovery Codes βœ… ❌
Regenerate MFA Recovery Codes βœ… ❌
Update Name βœ… ❌
Update Password βœ… ❌
Update Phone βœ… ❌
Get Account Preferences βœ… ❌
Update Preferences βœ… ❌
Create Password Recovery βœ… ❌
Create Password Recovery (Confirmation) βœ… ❌
List Sessions βœ… ❌
Delete Sessions βœ… ❌
Create Anonymous Session βœ… βœ…
Create Email Password Session βœ… βœ…
Update Magic URL Session βœ… βœ…
Create OAuth2 Session βœ… βœ…
Update Phone Session βœ… βœ…
Create Session βœ… βœ…
Get Session βœ… ❌
Update Session βœ… ❌
Delete Session βœ… ❌
Update Status βœ… ❌
Create Push Target βœ… ❌
Update Push Target βœ… ❌
Delete Push Target βœ… ❌
Create Email Token (OTP) βœ… βœ…
Create Magic URL Token βœ… βœ…
Create OAuth2 Token βœ… βœ…
Create Phone Token βœ… βœ…
Create Email Verification βœ… ❌
Create Email Verification (Confirmation) βœ… ❌
Create Phone Verification βœ… ❌
Create Phone Verification (Confirmation) βœ… ❌

Users

Account - 42 / 42

Endpoint Client Server
List Users ❌ βœ…
Create User ❌ βœ…
Create User with Argon2 Password ❌ βœ…
Create User with Bcrypt Password ❌ βœ…
List Identities ❌ βœ…
Delete Identity ❌ βœ…
Create User with MD5 Password ❌ βœ…
Create User with PHPass Password ❌ βœ…
Create User with Scrypt Password ❌ βœ…
Create User with Scrypt Modified Password ❌ βœ…
Create User with SHA Password ❌ βœ…
Get User ❌ βœ…
Delete User ❌ βœ…
Update Email ❌ βœ…
Create User JWT ❌ βœ…
Update User Labels ❌ βœ…
List User Logs ❌ βœ…
List User Memberships ❌ βœ…
Update MFA ❌ βœ…
Delete Authenticator ❌ βœ…
List Factors ❌ βœ…
Get MFA Recovery Codes ❌ βœ…
Regenerate MFA Recovery Codes ❌ βœ…
Create MFA Recovery Codes ❌ βœ…
Update Name ❌ βœ…
Update Password ❌ βœ…
Update Phone ❌ βœ…
Get User Preferences ❌ βœ…
Update User Preferences ❌ βœ…
List User Sessions ❌ βœ…
Create Session ❌ βœ…
Delete User Sessions ❌ βœ…
Delete User Session ❌ βœ…
Update User Status ❌ βœ…
List User Targets ❌ βœ…
Create User Target ❌ βœ…
Get User Target ❌ βœ…
Update User Target ❌ βœ…
Delete User Target ❌ βœ…
Create Token ❌ βœ…
Update Email Verification ❌ βœ…
Update Phone Verification ❌ βœ…

Teams

Teams - 25 / 25

Endpoint Client Server
List Teams βœ… βœ…
Create Team βœ… βœ…
Get Team βœ… βœ…
Update Name βœ… βœ…
Delete Team βœ… βœ…
List Team Memberships βœ… βœ…
Create Team Membership βœ… βœ…
Get Team Membership βœ… βœ…
Update Membership βœ… βœ…
Delete Team Membership βœ… βœ…
Update Team Membership Status βœ… ❌
Get Team Memberships βœ… βœ…
Update Preferences βœ… βœ…

Databases

Databases - 47 / 47

Endpoint Client Server
List Databases ❌ βœ…
Create Databases ❌ βœ…
Get Database ❌ βœ…
Update Database ❌ βœ…
Delete Database ❌ βœ…
List Collections ❌ βœ…
Create Collection ❌ βœ…
Get Collections ❌ βœ…
Update Collection ❌ βœ…
Delete Collection ❌ βœ…
List Attributes ❌ βœ…
Create Boolean Attribute ❌ βœ…
Update Boolean Attribute ❌ βœ…
Create Datetime Attribute ❌ βœ…
Update Datetime Attribute ❌ βœ…
Create Email Attribute ❌ βœ…
Update Email Attribute ❌ βœ…
Create Enum Attribute ❌ βœ…
Update Enum Attribute ❌ βœ…
Create Float Attribute ❌ βœ…
Update Float Attribute ❌ βœ…
Create Integer Attribute ❌ βœ…
Update Integer attribute ❌ βœ…
Create IP Address Attribute ❌ βœ…
Update IP Address Attribute ❌ βœ…
Create Relationship Attribute ❌ βœ…
Create String Attribute ❌ βœ…
Update String Attribute ❌ βœ…
Create URL Attribute ❌ βœ…
Update URL Attribute ❌ βœ…
Get Attribute ❌ βœ…
Delete Attribute ❌ βœ…
Update Relationship Attribute ❌ βœ…
List Documents βœ… βœ…
Create Document βœ… βœ…
Get Document βœ… βœ…
Update Document βœ… βœ…
Delete Document βœ… βœ…
List Indexes ❌ βœ…
Create Index ❌ βœ…
Get Index ❌ βœ…
Delete Index ❌ βœ…

Storage

storage - 0 / 21

Endpoint Client Server
List Buckets ❌ ⬛
Create Bucket ❌ ⬛
Get Bucket ❌ ⬛
Update Bucket ❌ ⬛
Delete Bucket ❌ ⬛
List Files ⬛ ⬛
Create File ⬛ ⬛
Get File ⬛ ⬛
Update File ⬛ ⬛
Delete File ⬛ ⬛
Get File For Download ⬛ ⬛
Get File Preview ⬛ ⬛
Get File For View ⬛ ⬛

Functions

Functions - 0 / 24

Endpoint Client Server
List Functions ❌ ⬛
Create Function ❌ ⬛
List Runtimes ❌ ⬛
Get Function ❌ ⬛
Update Function ❌ ⬛
Delete Function ❌ ⬛
List Deployments ❌ ⬛
Create Deployment ❌ ⬛
Get Deployment ❌ ⬛
Update Function Deployment ❌ ⬛
Delete Deployment ❌ ⬛
Create Build ❌ ⬛
Download Deployment ❌ ⬛
List Executions ⬛ ⬛
Create Execution ⬛ ⬛
Get Execution ⬛ ⬛
List Variables ❌ ⬛
Create Variable ❌ ⬛
Get Variable ❌ ⬛
Update Variable ❌ ⬛
Delete Variable ❌ ⬛

Messaging

Messaging - 0 / 48

Endpoint Client Server
List Messages ❌ ⬛
Create Email ❌ ⬛
Update Email ❌ ⬛
Create Push Notification ❌ ⬛
Update Push Notification ❌ ⬛
Create SMS ❌ ⬛
Update SMS ❌ ⬛
Get Message ❌ ⬛
Delete Message ❌ ⬛
List Message Logs ❌ ⬛
List Message Targets ❌ ⬛
List Providers ❌ ⬛
Create APNS Provider ❌ ⬛
Update APNS Provider ❌ ⬛
Create FCM Provider ❌ ⬛
Update FCM Provider ❌ ⬛
Create Mailgun Provider ❌ ⬛
Update Mailgun Provider ❌ ⬛
Create Msg91 Provider ❌ ⬛
Update Msg91 Provider ❌ ⬛
Create Sendgrid Provider ❌ ⬛
Update Sendgrid Provider ❌ ⬛
Create SMTP Provider ❌ ⬛
Update SMTP Provider ❌ ⬛
Create Telesign Provider ❌ ⬛
Update Telesign Provider ❌ ⬛
Create Textmagic Provider ❌ ⬛
Update Textmagic Provider ❌ ⬛
Create Twilio Provider ❌ ⬛
Update Twilio Provider ❌ ⬛
Create Vonage Provider ❌ ⬛
Update Vonage Provider ❌ ⬛
Get Provider ❌ ⬛
Delete Provider ❌ ⬛
List Provider Logs ❌ ⬛
List Subscriber Logs ❌ ⬛
List Topics ❌ ⬛
Create Topic ❌ ⬛
Get Topic ❌ ⬛
Update Topic ❌ ⬛
Delete Topic ❌ ⬛
List Topic Logs ❌ ⬛
List Subscribers ❌ ⬛
Create Subscriber ⬛ ⬛
Get Subscriber ❌ ⬛
Delete Subscriber ⬛ ⬛

Locale

Locale - 0 / 15

Endpoint Client Server
Get User Locale ⬛ ❌
List Locale Codes ⬛ ⬛
List Continents ⬛ ⬛
List Countries ⬛ ⬛
List EU Countries ⬛ ⬛
List Countries Phone Codes ⬛ ⬛
List Currencies ⬛ ⬛
List Languages ⬛ ⬛

Avatars

Avatars - 0 / 14

Endpoint Client Server
Get Browser Icon ⬛ ⬛
Get Credit Card Icon ⬛ ⬛
Get Favicon ⬛ ⬛
Get Country Flag ⬛ ⬛
Get Image From Url ⬛ ⬛
Get Initials ⬛ ⬛
Get QR Code ⬛ ⬛

Health

Health - 0 / 23

Endpoint Client Server
Get HTTP ❌ ⬛
Get Antivirus ❌ ⬛
Get Cache ❌ ⬛
Get the SSL certificate for a domain ❌ ⬛
Get DB ❌ ⬛
Get PubSub ❌ ⬛
Get Queue ❌ ⬛
Get Builds Queue ❌ ⬛
Get Certificates Queue ❌ ⬛
Get Databases Queue ❌ ⬛
Get Deletes Queue ❌ ⬛
Get Number of Failed Jobs ❌ ⬛
Get Functions Queue ❌ ⬛
Get Logs Queue ❌ ⬛
Get Mails Queue ❌ ⬛
Get Messaging Queue ❌ ⬛
Get Migrations Queue ❌ ⬛
Get Usage Queue ❌ ⬛
Get Usage Dump Queue ❌ ⬛
Get Webhooks Queue ❌ ⬛
Get Storage ❌ ⬛
Get Local Storage ❌ ⬛
Get Time ❌ ⬛
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2.2.0 468 3/6/2025
2.1.2 169 3/2/2025
2.1.1 194 3/2/2025
2.1.0 181 3/1/2025
2.0.6 170 2/24/2025
2.0.5 168 2/4/2025
2.0.4 158 1/24/2025
2.0.3 161 1/24/2025
2.0.2 163 1/24/2025
2.0.1 152 1/23/2025
2.0.0 151 1/23/2025