DirectScale Developers

DirectScale Developers

Get Started    API Reference

What is the Client Extension?

Available for Business and Premium tiers

The Client Extension is a way to expand the base DirectScale Platform functionality. It's a template of sorts made of C# files stored in a GitHub repository. Whenever base code runs, it looks at the Extension to see if any custom code overrides or changes it. The main way this communication occurs is through Hooks.

The client must request access to the Extension. Find out how in the Help Center: Gaining Access to the Client Extension.

In the Extension, two important elements must be there:

  • A Solution named after the client key (client ID).

    The Client ID is the same as the instance name in the Platform URL: {Client_ID}.admin.directscale.com.

  • The ExtentionEntry.cs file. The base code looks for this file when it tries to discover what type of custom code you've created. Register any code you write or Hooks you use in this file.



ConfigureServices()

In ExtensionEntry.cs, the ConfigureServices() function is the entry method of the Extension. Nothing will run without anything registered within it:

public class ExtensionEntry : IExtension
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Include service registrations here.    
     }
}

For example, when registering an API endpoint:

public class ExtensionEntry : IExtension
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddSingleton<IApiEndpoint, ApiExample>();
    }
}

DirectScale consumes client registrations in an unusual way. Because of that, the order of the dependency registrations matters. For example, when you register an API, it actually resolves to an instance. If the API has dependencies that weren't registered yet, then you'll get an error when trying to deploy. The same applies for money in/money out integrations; they must be registered after any dependent service registrations.



Assembly Versions

There are two assemblies with specific, required versions:

You must not update these packages. If you load other versions, the Extension will not work as intended.


The rest of the Extension can be set up and structured in your own way.

Updated a day ago


What is the Client Extension?


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.