Skip to content

About

Schuly plugin contract (NuGet package)

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SchulyPluginAbstractions

Schuly Logo

The contract every Schuly plugin implements.

NuGet .NET 10 MIT license

Install

dotnet add package Schuly.Plugin.Abstractions
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Schuly.Plugin.Abstractions;

public sealed class MyPlugin : ISchulyPlugin
{
    public string Name => "My School";
    public string Version => "1.0.0";

    public void ConfigureServices(IServiceCollection services, PluginServiceContext context) { }

    public void ConfigureEndpoints(IEndpointRouteBuilder endpoints) =>
        endpoints.MapGet("/api/plugins/myschool/hello", () => "Hello from my plugin");

    public Task MigrateAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken = default) =>
        Task.CompletedTask;
}

That's a whole plugin. SchulyServer finds the class, and the plugin never touches the server's source or database.

Beyond that

Implement these when your plugin needs them:

  • IPluginLogin: connect a school account, and put your school system in the app's picker
  • IPluginBackgroundTask: recurring work on a PluginSchedule
  • IPluginEventHandler<TCommand>: react to application commands
  • ILinkProvider: link an outside account

The server hands you ISchoolData, IPluginVault, IPluginFileStore, IPluginUserContext and ILinkedAccounts.

The contract has every member, versioning says what counts as breaking, and Add a plugin goes from here to a loaded plugin.

License

MIT

About

Schuly plugin contract (NuGet package)

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages