Skip to content

aleqkzander/Pocketsharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pocketsharp - Alpha 1.0.0.0

Pocketsharp is a C# library designed to easily connect with Pocketbase and is compatible with .NET 8.0 applications


How to Use Pocketsharp


  • Add the using directive (optional)
    using Pocketsharp

  • Access the methods
    string response = Pocketsharp.Authentication.EmailAndPassword.RegisterAsync(HttpClient client, Record record, string password, string passwordConfirm);
    string response = Pocketsharp.Authentication.EmailAndPassword.LoginAsync(HttpClient client, string email, string password);

    byte[] response = Pocketsharp.User.DownloadAvatar(HttpClient client, Response authResponse);
    string response = Pocketsharp.User.UpdateAsync(HttpClient client, Response authResponse, string? oldPassword = null, string? newPassword = null, string? passwordConfirm = null);
    bool response = Pocketsharp.User.DeleteAsync(HttpClient client, string recordId, string token);

    string response = Pocketsharp.Collection.CreateEntry(HttpClient client, string authToken, string targetCollection, object userObject);
    JsonNode response = Pocketsharp.Collection.GetAllEntrysFromTarget(HttpClient client, string authToken, string targetCollection);
    string response = Pocketsharp.Collection.GetSpecificEntryFromTarget(HttpClient client, string authToken, string targetCollection, string entryId);

  • Access the objects
    Pocketsharp.Objects.Record record = new();
    Pocketsharp.Objects.Response response = new();

  • Access the json converter
    string jsonRecord = Pocketsharp.Utility.JsonUtility.SerializeRecordToJson(recordObject);
    Pocketsharp.Objects.Record recordFromJson = Pocketsharp.Utility.JsonUtility.DeserializeJsonToRecord(jsonRecord);

    string jsonResponse = Pocketsharp.Utility.JsonUtility.SerializeResponseToJson(responseObject);
    Pocketsharp.Objects.Response = Pocketsharp.Utility.JsonUtility.DeserializeJsonToResponse(jsonResponse);

2. Example project

Check out this Windows Forms project to see a demonstration of Pocketsharp in action

About

Csharp SDK for Pocketbase

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages