JSPM

  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q83195F
  • License MIT

Angular library for Medha One Access admin dashboard functionality

Package Exports

  • @medha-analytics/medha-one-access
  • @medha-analytics/medha-one-access/package.json

Readme

@medha-analytics/medha-one-access

Angular library for Medha One Access admin dashboard functionality.

Installation

npm install @medha-analytics/medha-one-access

Requirements

  • Angular 15 or higher
  • Angular Material
  • Angular CDK
  • Material Icons font

Setup

1. Add Material Icons to your index.html

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

2. Import the module in your app

import { MedhaOneAccessModule } from '@medha-analytics/medha-one-access';

@NgModule({
  imports: [
    MedhaOneAccessModule.forRoot({
      apiUrl: 'https://your-api-url.com/api',
      secretKey: 'your-secret-key',
      currentApplication: 'your-app-name'
      // enableInterceptor: true // Optional - defaults to true
    })
  ]
})
export class AppModule { }

3. Use the component in your template

<medha-one-access
  [apiUrl]="apiUrl"
  [secretKey]="secretKey"
  [currentApplication]="applicationName">
</medha-one-access>

HTTP Interceptor Behavior

The library includes a smart HTTP interceptor that:

  • Only processes requests to your configured apiUrl - other API calls pass through untouched
  • Respects existing Authorization headers - if another interceptor already added auth, it won't override
  • Works alongside other interceptors - properly chains with your application's interceptors
  • Handles errors gracefully - if token generation fails, requests still proceed
  • Uses multi: true - correctly registers as an additional interceptor, not a replacement

Features

  • User Management
  • User Groups Management
  • Access Rules Configuration
  • Artifacts Management
  • Hierarchical Organization Structure
  • Role-based Access Control
  • Configurable HTTP Authentication

Peer Dependencies

  • @angular/common: >=15.0.0
  • @angular/core: >=15.0.0
  • @angular/cdk: >=15.0.0
  • @angular/material: >=15.0.0
  • @angular/router: >=15.0.0
  • @angular/forms: >=15.0.0
  • crypto-js: ^4.2.0

Troubleshooting

HTTP Interceptor Conflicts

The interceptor is designed to work alongside existing interceptors without conflicts:

  • It only processes requests matching your configured apiUrl
  • It won't override existing Authorization headers
  • It properly chains with other interceptors using Angular's multi: true token

If you still experience issues:

  1. Ensure your apiUrl is unique and doesn't overlap with other APIs
  2. Check that your interceptor registration order is correct
  3. Verify that your secret key is properly configured

License

MIT © Medha Analytics