The Wayback Machine - https://web.archive.org/web/20200914182114/https://github.com/sqreen/sqreen-dotnet
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

README.md

Sqreen .NET SDK

Build Status

This solution contains multiple .NET packages for using Sqreen.

Supported runtime and web frameworks:

⚠️ WARNING: these are early versions of the SDK, and should not be considered ready for production use.

Targets Web Project
netstandard2.0, net47 ASP.NET Core 2 Sqreen.SDK.AspNetCore2 NuGet version

Environment variables

  • SQREEN_APP_NAME
  • SQREEN_TOKEN
  • SQREEN_BACK_URL
  • SQREEN_LOG_LEVEL (case insensitive)
    • TRACE
    • DEBUG
    • INFORMATION (Default)
    • WARNING
    • ERROR
    • NONE

Supported Sqreen Features

Sqreen.SDK.AspNetCore2

  • manual user signin, and signup tracking;
  • sending custom events (only the event name gets sent. No request/response properties);
  • security responses:
    • IP blocking;

Quick start

To use Sqreen in your ASP.NET Core 2 application, first you need to register the middleware:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseSqreen();
    /* ... */
}

NOTE: the middleware must be the first to be registered. If it is not the first, it will raise an exception (this behaviour can be overridden manually to allow any order).

Next step is to register the services for dependency injection:

public void ConfigureServices(IServiceCollection services)
{
    /* ... */
    services.AddSqreenServices();
    /* ... */
}
Configuration

To configure Sqreen, you can use the environment variables SQREEN_TOKEN, SQREEN_APP_NAME, and SQREEN_LOG_LEVEL.

Alternatively, you can configure Sqreen options in ConfigureServices:

services.PostConfigure<SqreenConfiguration>(c =>
{
    c.Token = "org_...";
    c.ApplicationName = "My Application Name";
});
Using the Sqreen SDK for tracking users and events

The Sqreen SDK is accessible through dependency injection. Just add ISqreenSdk as a parameter.

You can then use the SDK to track events, logins, and signups.

⚠️ Note that the SDK does not implement the Identify call, and the events do not include request properties. So that e.g. Sqreen Playbooks that use event properties might not work.

Sqreen.Core

❗️ This package is a support package for the SDK implementation, and not needed for web applications.

This package targets the oldest netstandard and .NET framework/runtime versions possible. It should contain as much code as possible.

netstandard1.0
net20

Sqreen.Core.Modern

❗️ This package is a support package for the SDK implementation, and not needed for web applications.

This package supplements Sqreen.Core with more interfaces and implementations that support more modern asynchronous access patterns.

netstandard1.1
net45

Sqreen.SDK.AspNetCore2

This is a Sqreen SDK implementation targeting

netstandard2.0
net47

It contains the Sqreen SDK for use with ASP.NET Core 2.

Sqreen.Weblog.CoreApp31.AspNetCore2

❗️ This package is a support package for the SDK implementation, and not needed for web applications.

This is a .NET Core 3.1 web application, which can be used to test the SDK.

It runs on .NET Core 3.1 (netcoreapp3.1).

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.