npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dataunlocker/defender-angular

v1.1.0

Published

DataUnlocker Defender for Angular applications.

Readme

@dataunlocker/defender-angular

Angular integration for DataUnlocker Defender. This package provides a standalone component to protect your Angular application from content blockers using DataUnlocker.

Installation

Before installing this package, you need to set up the DATAUNLOCKER_ID environment variable.

Setting up DATAUNLOCKER_ID

You can set the environment variable in one of the following ways:

Option 1: Using .npmrc file

Create a .npmrc file in your project root:

DATAUNLOCKER_ID=your_dataunlocker_id_here

Option 2: Using environment variable

Set the environment variable before installing the package:

# For Unix/Linux/macOS
export DATAUNLOCKER_ID=your_dataunlocker_id_here

# For Windows (Command Prompt)
set DATAUNLOCKER_ID=your_dataunlocker_id_here

# For Windows (PowerShell)
$env:DATAUNLOCKER_ID="your_dataunlocker_id_here"

You can also provide DATAUNLOCKER_ID in your deployment pipeline or build cloud environment.

Installing the library

After setting up the environment variable, install the library:

npm install @dataunlocker/defender-angular

Usage

1. Import the Component

Import DefenderComponent in your root layout:

import { DefenderComponent } from "@dataunlocker/defender-angular";

@Component({
  imports: [DefenderComponent],
  // ...
})
export class AppComponent {}

2. Wrap your app with Defender

Add <defender> as a top-level wrapper component on your app.

<defender>
  <!-- Your protected content goes here -->
  <div>This is your web application code</div>
</defender>

Defender slightly changes how your app is rendered, and introduces an extra <div> around your app's content. You can style this <div> any way you want.

You can also listen to loaded and errored events of Defender, either with @dataunlocker/defender-angular binding or from the base package @dataunlocker/defender. You can init your app or tracking code on the loaded event, but mind that placing code in DataUnlocker's Secure Enclave gives you a better protection against blockers.

<!-- (loaded) accepts data returned by Secure Enclave, (errored) accepts error code -->
<defender
  (loaded)="onLoad($event)"
  (errored)="onError($event)">
  ...
</defender>

Examples

With Navigation

<defender>
  <nav>
    <!-- Navigation content -->
  </nav>
  <main>
    <router-outlet></router-outlet>
  </main>
</defender>

Support

For issues and feature requests, please feel free to open the issue at @dataunlocker/defender-angular or contact DataUnlocker support.