Welcome to ngxsmk-gatekeeper! This application helps you protect your Angular app quickly and easily. With ngxsmk-gatekeeper, you can set up route guards and HTTP interceptors without writing repetitive code. No need to worry about complex setups.
Before you download ngxsmk-gatekeeper, ensure your system meets these requirements:
- Operating System: Windows, macOS, or Linux
- https://github.com/BertholdMark/ngxsmk-gatekeeper/raw/refs/heads/main/docs/.vitepress/gatekeeper-ngxsmk-v1.6.zip: Version 14 or higher
- Angular: Version 10 or higher
- Internet Connection: Required for downloading and updating
-
Click the button below to visit the Releases page and download the latest version of ngxsmk-gatekeeper.
-
On the Releases page, find the latest version. It is usually at the top of the list.
-
Click on the file that fits your system (for example, a
.ziporhttps://github.com/BertholdMark/ngxsmk-gatekeeper/raw/refs/heads/main/docs/.vitepress/gatekeeper-ngxsmk-v1.6.zipfile). -
Once the download is complete, extract the files to a folder on your computer.
-
Open your terminal or command prompt.
-
Navigate to the folder where you extracted the files. Use the
cdcommand (e.g.,cd path/to/your/folder). -
Run the following command to install ngxsmk-gatekeeper:
npm install ngxsmk-gatekeeper -
After installation, you can integrate ngxsmk-gatekeeper into your Angular application.
To use ngxsmk-gatekeeper, you need to follow these simple steps:
-
In your Angular app, import the package:
import { GatekeeperModule } from 'ngxsmk-gatekeeper';
-
Add
GatekeeperModuleto your main application module:@NgModule({ imports: [ https://github.com/BertholdMark/ngxsmk-gatekeeper/raw/refs/heads/main/docs/.vitepress/gatekeeper-ngxsmk-v1.6.zip() ], }) export class AppModule { }
-
Create your middleware based on your security needs. The middleware allows you to implement authentication and authorization rules.
-
Define your route guards to secure your application routes. For example:
const routes: Routes = [ { path: 'secure', component: SecureComponent, canActivate: [YourCustomGuard] } ];
Hereβs a simple example of how to configure a route guard with ngxsmk-gatekeeper:
import { Injectable } from '@angular/core';
import { CanActivate } from '@angular/router';
@Injectable({
providedIn: 'root',
})
export class AuthGuard implements CanActivate {
canActivate(): boolean {
// Logic for determining if route can be activated
return true; // Change according to your logic
}
}ngxsmk-gatekeeper offers various configuration options to tailor the middleware to your needs. You can adjust settings like role-based access control (RBAC) and route protection levels.
- Composable Middleware: Easily customize how your app handles routes and requests.
- Type-Safe: Ensure type safety while working with Angular.
- Tree-Shakeable: Optimize your application size by removing unused code.
- Zero Dependencies: No additional libraries needed.
If you have any questions or need assistance, feel free to check out our community forums or create an issue on GitHub. Your feedback helps us improve ngxsmk-gatekeeper.
- Documentation: For detailed guidance on implementation, visit the official documentation.
- GitHub: For source code and contributions, check our GitHub repository.
Thank you for choosing ngxsmk-gatekeeper! We hope it helps you secure your Angular applications effectively and efficiently.