Blink.NET 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blink.NET --version 1.0.2
                    
NuGet\Install-Package Blink.NET -Version 1.0.2
                    
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="Blink.NET" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blink.NET" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Blink.NET" />
                    
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 Blink.NET --version 1.0.2
                    
#r "nuget: Blink.NET, 1.0.2"
                    
#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 Blink.NET@1.0.2
                    
#: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=Blink.NET&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Blink.NET&version=1.0.2
                    
Install as a Cake Tool

License NuGet NuGet version FuGet Build CodeFactor Repo size

Blink.NET

A .NET library (netstandard2.1) for accessing local Blink camera storage: fetching the list of clips, downloading and deleting videos. Works on runtimes that support .NET Standard 2.1 (for example .NET 6/7/8/9, .NET Core 3.0+).

Features

  • Login/password authorization and PIN confirmation (2FA).
  • Fetching dashboard data and the list of Sync Modules.
  • Getting the list of clips from a module's local storage.
  • Download a clip as a byte array.
  • Delete a clip from the device.
  • Configurable delay between requests to stabilize the API.

Installation

Via .NET CLI:

dotnet add package Blink.NET

Via PackageReference:

<ItemGroup>
    <PackageReference Include="Blink.NET" Version="x.y.z" />
    
</ItemGroup>

Quick start

Simple scenario: login, complete 2FA, then download clips from a single Sync Module.

using Blink;

var client = new BlinkClient();

// 1) Login with email/password
bool okLogin = await client.TryLoginAsync("you@example.com", "YourPassword");
if (!okLogin)
{
  throw new Exception("Wrong email or password");
}

// 2) Enter and verify 2FA code
Console.Write("Enter 2FA code: ");
var code = Console.ReadLine() ?? string.Empty;
bool ok2FA = await client.TryVerifyPinAsync(code);
if (!ok2FA)
{
  throw new Exception("Invalid 2FA code");
}

// 3) Get clips from a single Sync Module (throws if more than one module exists)
var videos = await client.GetVideosFromSingleModuleAsync();

// 4) Download the first clip as bytes
var first = videos.First();
byte[] bytes = await client.GetVideoBytesAsync(first);
File.WriteAllBytes($"{first.Id}.mp4", bytes);

Quick start (with Serilog and refresh token)

Use a two-stage flow: first login with email/password and complete 2FA to obtain a refresh token; then reuse the refresh token on subsequent runs to skip 2FA.

using Serilog;
using Blink;

Log.Logger = new LoggerConfiguration()
  .MinimumLevel.Debug()
  .WriteTo.Console()
  .CreateLogger();

var client = new BlinkClient();

// 1) First-time login + 2FA to get refresh token
bool okLogin = await client.TryLoginAsync(email, password);
if (!okLogin)
{
  Log.Error("Wrong email or password");
  return;
}

Log.Information("Enter 2FA code:");
while (true)
{
  string code = Console.ReadLine() ?? string.Empty;
  if (string.IsNullOrWhiteSpace(code))
  {
    Log.Warning("Code cannot be empty. Please enter the 2FA code:");
    continue;
  }
  bool ok2FA = await client.TryVerifyPinAsync(code);
  if (ok2FA)
  {
    Log.Information("2FA verification successful.");
    break;
  }
  Log.Error("Invalid 2FA code. Please try again:");
}

Log.Information("Save this refresh token for future use: {RefreshToken}", client.RefreshToken);

// 2) Subsequent runs — login with refresh token
bool okRefresh = await client.TryLoginWithRefreshTokenAsync(refreshTokenFromStore);
if (!okRefresh)
{
  Log.Error("Failed to refresh token");
  return;
}

var dashboard = await client.GetDashboardAsync();
Log.Information("Dashboard retrieved. Modules count: {Count}", dashboard.SyncModules.Length);

Step-by-step usage

  1. Login and, if necessary, PIN confirmation:
bool okLogin = await client.TryLoginAsync(email, password);
if (!okLogin)
{
  // invalid credentials
  return;
}
bool ok2FA = await client.TryVerifyPinAsync(pinFromSms);
if (!ok2FA)
{
  // invalid/expired code
  return;
}
  1. Get Sync Modules and clips:
var dashboard = await client.GetDashboardAsync();
var module = dashboard.SyncModules.Single(); // choose the desired module
var videos = await client.GetVideosFromModuleAsync(module);
  1. Download a clip and (optionally) delete it:
var data = await client.GetVideoBytesAsync(video);
await File.WriteAllBytesAsync($"{video.Id}.mp4", data);

// if needed — delete the clip from the device
// await client.DeleteVideoAsync(video);

Client settings

  • GeneralSleepTime (int, default 3500 ms) Small delay between requests. Without it the server may sometimes return an empty response. You can reduce or disable it if your environment is stable. For background jobs, consider higher values (e.g., 5–10 seconds) to improve reliability.

Token handling:

  • RefreshToken (string?) — populated after successful 2FA. Store it securely and use TryLoginWithRefreshTokenAsync to skip 2FA on subsequent runs.

Brief API overview

  • Task<Dashboard> GetDashboardAsync()
  • Task<IEnumerable<BlinkVideoInfo>> GetVideosFromModuleAsync(SyncModule module)
  • Task<IEnumerable<BlinkVideoInfo>> GetVideosFromSingleModuleAsync()
  • Task<byte[]> GetVideoBytesAsync(BlinkVideoInfo video, int tryCount = 3)
  • Task DeleteVideoAsync(BlinkVideoInfo video)

Login/token flows:

  • Task<bool> TryLoginAsync(string email, string password)
  • Task<bool> TryVerifyPinAsync(string code)
  • Task<bool> TryLoginWithRefreshTokenAsync(string refreshToken)
  • string? RefreshToken { get; }

Events:

  • event Action<string>? OnTokenRefreshed — raised whenever a new refresh token is issued (after successful 2FA or token refresh). Subscribe to persist it:
var client = new BlinkClient();
client.OnTokenRefreshed += token => SaveRefreshToken(token);

See models and exceptions in Sources/Blink/Models and Sources/Blink/Exceptions.

Sample console application from the repository

There is a small example in Sources/Blink.ConsoleTest:

  1. Create a secrets.json file next to Program.cs with your login/password:
{
  "email": "you@example.com",
  "password": "YourPassword"
}
  1. Build and run:
cd Sources/Blink.ConsoleTest
dotnet build
dotnet run

Requirements and limitations

  • A Blink account and at least one Sync Module with local storage are required.
  • Client verification (PIN via SMS) is often enabled. This is normal behavior.
  • The Blink API can be unstable without pauses between requests — use GeneralSleepTime.

Security

  • Do not store login/password in the repository. Use user secrets, environment variables, or encrypted stores.
  • Remove tokens and personal data from logs before publishing.

Building from source

dotnet build Sources/Blink/Blink.csproj

Disclaimer

This project is not affiliated with Blink, Amazon, or any other companies. Use at your own risk and in accordance with Blink's terms of service.

License

MIT — see LICENSE.md.

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
1.0.6 147 12/6/2025
1.0.5 204 10/19/2025
1.0.4 159 10/19/2025
1.0.3 170 10/19/2025
1.0.2 169 10/19/2025
1.0.1 173 10/19/2025
1.0.0 171 10/19/2025
0.1.18 184 10/1/2025
0.1.17 202 9/5/2025
0.1.16 308 4/10/2025
0.1.15 209 4/9/2025
0.1.14 207 11/10/2024
0.1.13 152 10/30/2024
0.1.12 163 10/30/2024
0.1.11 147 10/22/2024
0.1.10 173 9/27/2024
0.1.9 183 9/27/2024
0.1.8 182 9/25/2024
0.1.7 199 9/24/2024
0.1.6 181 9/24/2024
0.1.5 180 9/24/2024
0.1.4 179 9/24/2024
0.1.3 155 9/24/2024
0.1.2 204 9/24/2024
0.1.1 189 9/24/2024
0.1.0 190 9/16/2024