{"id":25830908,"url":"https://github.com/lab5e/ng-userapi","last_synced_at":"2026-06-24T03:31:27.562Z","repository":{"id":97096105,"uuid":"355858850","full_name":"lab5e/ng-userapi","owner":"lab5e","description":"Angular User API client","archived":false,"fork":false,"pushed_at":"2022-06-30T09:18:49.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T22:39:11.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lab5e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-08T10:19:28.000Z","updated_at":"2022-06-30T09:16:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"17126d07-3eb0-4b2a-befe-58f07aaa0442","html_url":"https://github.com/lab5e/ng-userapi","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/lab5e/ng-userapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-userapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-userapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-userapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-userapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lab5e","download_url":"https://codeload.github.com/lab5e/ng-userapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fng-userapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268370084,"owners_count":24239762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-28T19:34:43.191Z","updated_at":"2025-10-29T21:02:12.036Z","avatar_url":"https://github.com/lab5e.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @lab5e/ng-userapi@1.3.13\n\n### Building\n\nTo install the required dependencies and to build the typescript sources run:\n```\nnpm install\nnpm run build\n```\n\n### publishing\n\nFirst build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)\n\n### consuming\n\nNavigate to the folder of your consuming project and run one of next commands.\n\n_published:_\n\n```\nnpm install @lab5e/ng-userapi@1.3.13 --save\n```\n\n_without publishing (not recommended):_\n\n```\nnpm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save\n```\n\n_It's important to take the tgz file, otherwise you'll get trouble with links on windows_\n\n_using `npm link`:_\n\nIn PATH_TO_GENERATED_PACKAGE/dist:\n```\nnpm link\n```\n\nIn your project:\n```\nnpm link @lab5e/ng-userapi\n```\n\n__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.\nPlease refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.\nPublished packages are not effected by this issue.\n\n\n#### General usage\n\nIn your Angular project:\n\n\n```\n// without configuring providers\nimport { ApiModule } from '@lab5e/ng-userapi';\nimport { HttpClientModule } from '@angular/common/http';\n\n@NgModule({\n    imports: [\n        ApiModule,\n        // make sure to import the HttpClientModule in the AppModule only,\n        // see https://github.com/angular/angular/issues/20575\n        HttpClientModule\n    ],\n    declarations: [ AppComponent ],\n    providers: [],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n```\n// configuring providers\nimport { ApiModule, Configuration, ConfigurationParameters } from '@lab5e/ng-userapi';\n\nexport function apiConfigFactory (): Configuration {\n  const params: ConfigurationParameters = {\n    // set configuration parameters here.\n  }\n  return new Configuration(params);\n}\n\n@NgModule({\n    imports: [ ApiModule.forRoot(apiConfigFactory) ],\n    declarations: [ AppComponent ],\n    providers: [],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n```\n// configuring providers with an authentication service that manages your access tokens\nimport { ApiModule, Configuration } from '@lab5e/ng-userapi';\n\n@NgModule({\n    imports: [ ApiModule ],\n    declarations: [ AppComponent ],\n    providers: [\n      {\n        provide: Configuration,\n        useFactory: (authService: AuthService) =\u003e new Configuration(\n          {\n            basePath: environment.apiUrl,\n            accessToken: authService.getAccessToken.bind(authService)\n          }\n        ),\n        deps: [AuthService],\n        multi: false\n      }\n    ],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n```\nimport { DefaultApi } from '@lab5e/ng-userapi';\n\nexport class AppComponent {\n    constructor(private apiGateway: DefaultApi) { }\n}\n```\n\nNote: The ApiModule is restricted to being instantiated once app wide.\nThis is to ensure that all services are treated as singletons.\n\n#### Using multiple OpenAPI files / APIs / ApiModules\nIn order to use multiple `ApiModules` generated from different OpenAPI files,\nyou can create an alias name when importing the modules\nin order to avoid naming conflicts:\n```\nimport { ApiModule } from 'my-api-path';\nimport { ApiModule as OtherApiModule } from 'my-other-api-path';\nimport { HttpClientModule } from '@angular/common/http';\n\n@NgModule({\n  imports: [\n    ApiModule,\n    OtherApiModule,\n    // make sure to import the HttpClientModule in the AppModule only,\n    // see https://github.com/angular/angular/issues/20575\n    HttpClientModule\n  ]\n})\nexport class AppModule {\n\n}\n```\n\n\n### Set service base path\nIf different than the generated base path, during app bootstrap, you can provide the base path to your service. \n\n```\nimport { BASE_PATH } from '@lab5e/ng-userapi';\n\nbootstrap(AppComponent, [\n    { provide: BASE_PATH, useValue: 'https://your-web-service.com' },\n]);\n```\nor\n\n```\nimport { BASE_PATH } from '@lab5e/ng-userapi';\n\n@NgModule({\n    imports: [],\n    declarations: [ AppComponent ],\n    providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],\n    bootstrap: [ AppComponent ]\n})\nexport class AppModule {}\n```\n\n\n#### Using @angular/cli\nFirst extend your `src/environments/*.ts` files by adding the corresponding base path:\n\n```\nexport const environment = {\n  production: false,\n  API_BASE_PATH: 'http://127.0.0.1:8080'\n};\n```\n\nIn the src/app/app.module.ts:\n```\nimport { BASE_PATH } from '@lab5e/ng-userapi';\nimport { environment } from '../environments/environment';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [ ],\n  providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],\n  bootstrap: [ AppComponent ]\n})\nexport class AppModule { }\n```  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fng-userapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flab5e%2Fng-userapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fng-userapi/lists"}