ngx-gdpr-guard
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

ngx-gdpr-guard

Logo

Angular library to use gdpr-guard as efficiently and easily as possible

Installation

npm i -S ngx-gdpr-guard

Setup

You'll need both a GdprManagerFactory and a GdprSavior.

NOTE: The recommended gdpr savior library is gdpr-guard-local which uses local storage by default, but can be customized to use anything.

You can use a very basic GdprManagerFactory using the GdprManagerBuilder as follows:

import { GdprManagerBuilder, GdprManagerFactory } from "gdpr-guard";

const managerFactory: GdprManagerFactory = () => GdprManagerBuilder.make()
	/* [...] */
	.build();

There's an injection token for both the factory and the savior:

import { GDPR_MANAGER_FACTORY_TOKEN, GDPR_SAVIOR_TOKEN } from "ngx-gdpr-guard";

const providers = [
	{ provide: GDPR_MANAGER_FACTORY_TOKEN, /* [...] */ },
	{ provide: GDPR_SAVIOR_TOKEN, /* [...] */ },
];

With these providers in scope, you can inject the NgxGdprGuardService:

import { NgModule } from "@angular/core";
import { NgxGdprGuardService } from "ngx-gdpr-guard";

@NgModule({
	declarations: [],
	imports: [],
	exports: [],
})
export class MyModule {
	constructor(private ngxGdprGuard: NgxGdprGuardService) {
	}
}

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-gdpr-guard

Weekly Downloads

0

Version

0.1.0

License

none

Unpacked Size

103 kB

Total Files

24

Last publish

Collaborators

  • voltra