An open-source toolkit that helps Nigerian developers implement Nigeria Data Protection Regulation (NDPR) and Data Protection Act (DPA) compliant features in their web applications.
npm install @tantainnovative/ndpr-toolkit
# or
yarn add @tantainnovative/ndpr-toolkit
# or
pnpm add @tantainnovative/ndpr-toolkitThis toolkit simplifies regulatory compliance for startups and businesses operating in Nigeria by providing ready-to-use components and tools for implementing data protection requirements.
New in v1.0.7: Complete flexibility with headless mode, custom UI support, and event-driven architecture.
- Flexible Implementation: Use pre-built UI, headless mode, or hybrid approach
- Full Customization: Override any component or behavior
- Event-Driven: Subscribe to consent changes with event listeners
- TypeScript Support: Fully typed with generic support for custom categories
- Granular Consent: Analytics, marketing, functional, and custom categories
- Audit Trail: Time-stamped consent history tracking
import { ConsentManager } from '@tantainnovative/ndpr-toolkit';
// Basic usage with pre-built UI
function App() {
return (
<ConsentManager>
{/* Your app content */}
</ConsentManager>
);
}
// Headless mode with custom UI
function HeadlessApp() {
return (
<ConsentManager headless>
<YourCustomBanner />
<YourCustomSettings />
</ConsentManager>
);
}See full consent management documentation
- Pre-built UI components for handling:
- Right to access personal data
- Right to rectification
- Right to erasure ("right to be forgotten")
- Right to restrict processing
- Right to data portability
- Dashboard for data controllers to manage requests
- Local storage requestService to track and update requests in demos
- Interactive wizard to create NDPR-compliant privacy policies
- Template system with customizable sections
- Auto-update notifications when regulatory requirements change
- Version history tracking
- Questionnaire-based tool to help organizations assess data processing risks
- Risk scoring matrix
- Mitigation recommendation engine
- Exportable reports for compliance documentation
- Templates for mandatory breach notifications
- Workflow for documenting breach details
- Timeline tracking to ensure 72-hour notification compliance
- Notification delivery to authorities via API (if available)
- Lightweight requestService storing requests in browser localStorage for demos
- Helper methods to update request status and retrieve history
import { ConsentManager, useConsent } from '@tantainnovative/ndpr-toolkit';
function App() {
return (
<ConsentManager onConsentChange={(consent) => console.log('Consent updated:', consent)}>
<YourApp />
</ConsentManager>
);
}
function YourApp() {
const { consentState, openSettings } = useConsent();
return (
<div>
{consentState.analytics && <AnalyticsScript />}
<button onClick={openSettings}>Manage Cookies</button>
</div>
);
}To contribute or run the demo locally:
# Clone the repository
git clone https://github.com/tantainnovative/ndpr-toolkit.git
cd ndpr-toolkit
# Install dependencies
pnpm install
# Run development server
pnpm devOpen http://localhost:3000 to see the demo.
This project is configured to deploy automatically to GitHub Pages using GitHub Actions. When you push changes to the main branch, the following will happen:
- The GitHub Actions workflow will build the project
- The built files will be deployed to GitHub Pages
- Your site will be available at
https://[your-username].github.io/ndpr-toolkit/
To manually deploy to GitHub Pages:
# Build the project
npm run build
# Deploy to GitHub Pages (if you have gh-pages installed)
npm run deployThe GitHub Pages deployment is configured in the following files:
next.config.ts- Contains the Next.js configuration for static export.github/workflows/deploy.yml- Contains the GitHub Actions workflow for automated deployment
- Next.js with App Router
- TypeScript
- Tailwind CSS
- React
This documentation site uses PostHog, an open-source, privacy-friendly analytics platform, to understand which features are most helpful to users. We collect only aggregated, anonymous data such as:
- Page views and popular demo pages
- Feature usage patterns
- Geographic data (country level only)
What we DON'T collect:
- Personal identifiable information (PII)
- Individual user tracking
- Form inputs or sensitive data
- Email addresses or contact information
PostHog is configured with person_profiles: 'identified_only', meaning we only create user profiles if you explicitly identify yourself. By default, all analytics are anonymous and aggregated.
You can opt-out of analytics by:
- Using browser extensions that block analytics
- Enabling "Do Not Track" in your browser
- Disabling JavaScript for this site
MIT License
Abraham Esandayinze Tanta
Senior Software Engineer with over a decade of experience in ethical hacking, software development, Linux and network administration. Based in Lagos, Nigeria.
- GitHub: @mr-tanta
- LinkedIn: linkedin.com/in/mr-tanta
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
If you find this toolkit helpful, please consider:
- ⭐ Starring the repository
- 🐛 Reporting bugs and issues
- 💡 Suggesting new features
- 🤝 Contributing to the codebase