{"id":13807591,"url":"https://github.com/avivharuzi/ngx-seo","last_synced_at":"2025-08-04T03:33:45.110Z","repository":{"id":46923512,"uuid":"256810208","full_name":"avivharuzi/ngx-seo","owner":"avivharuzi","description":"Update SEO title and meta tags easily in Angular apps","archived":false,"fork":false,"pushed_at":"2023-09-23T20:13:04.000Z","size":2730,"stargazers_count":14,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-19T05:38:29.928Z","etag":null,"topics":["angular","seo","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@avivharuzi/ngx-seo","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avivharuzi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-04-18T17:15:18.000Z","updated_at":"2024-09-04T00:50:44.000Z","dependencies_parsed_at":"2024-08-04T01:07:49.486Z","dependency_job_id":"41712fed-d008-4b44-9210-066557b995a3","html_url":"https://github.com/avivharuzi/ngx-seo","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":0.06521739130434778,"last_synced_commit":"7514aa10f8d5b07d7bb0fb104b920ea939800278"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/avivharuzi/ngx-seo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avivharuzi%2Fngx-seo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avivharuzi%2Fngx-seo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avivharuzi%2Fngx-seo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avivharuzi%2Fngx-seo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avivharuzi","download_url":"https://codeload.github.com/avivharuzi/ngx-seo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avivharuzi%2Fngx-seo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268644488,"owners_count":24283334,"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-04T02:00:09.867Z","response_time":79,"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":["angular","seo","typescript"],"created_at":"2024-08-04T01:01:27.325Z","updated_at":"2025-08-04T03:33:45.089Z","avatar_url":"https://github.com/avivharuzi.png","language":"TypeScript","funding_links":[],"categories":["Table of contents"],"sub_categories":["Angular"],"readme":"# ngx-seo\n\nUpdate SEO title and meta tags easily in Angular apps.\n\nI created this library because other libraries are not fit enough to my requirements.\n\n![npm](https://img.shields.io/npm/v/@avivharuzi/ngx-seo) ![NPM](https://img.shields.io/npm/l/@avivharuzi/ngx-seo) ![npm bundle size](https://img.shields.io/bundlephobia/min/@avivharuzi/ngx-seo)\n\n## Environment Support\n\n- Angular 6+\n- Server-side Rendering\n\n## Compatibility\n\nVersions compatibility list:\n\n| @avivharuzi/ngx-seo | Angular      |\n| ------------------- | ------------ |\n| 16.x.x              | 16.x.x       |\n| 15.x.x              | 15.x.x       |\n| 14.x.x              | 14.x.x       |\n| 13.x.x              | 13.x.x       |\n| 12.x.x              | 12.x.x       |\n| 11.x.x              | 11.x.x       |\n| 10.x.x              | 10.x.x       |\n| 1.x.x               | 6.xx - 9.x.x |\n\n## Installation\n\n```sh\nnpm i @avivharuzi/ngx-seo\n```\n\nOR\n\n```sh\nyarn install @avivharuzi/ngx-seo\n```\n\n## Usage\n\n### Import NgxSeoModule\n\nImport `NgxSeoModule` into `AppModule` imports.\n\n```ts\nimport { NgxSeoModule } from '@avivharuzi/ngx-seo';\n\nimports: [\n  // ...\n  NgxSeoModule.forRoot(),\n],\n```\n\n### Update Title and Meta Tags from Routes Data\n\nDeclare SEO data for each route recommended to use `NgxSeo` interface to prevent problems.\n\n```ts\n...\nimport { NgxSeo } from '@avivharuzi/ngx-seo';\n\n...\n\nconst SEO_HOME: NgxSeo = {\n  title: 'home page',\n  meta: {\n    description: 'home page description',\n  },\n};\n\nconst SEO_ABOUT: NgxSeo = {\n  title: 'about page',\n  meta: {\n    description: 'about page description',\n  },\n};\n\nconst routes: Routes = [\n  { path: '', component: HomeComponent, data: { seo: SEO_HOME } },\n  { path: 'about', component: AboutComponent, data: { seo: SEO_ABOUT } },\n];\n```\n\nYou can also specify custom meta tags by providing array of MetaDefinition.\n\n```ts\nconst SEO_SPECIAL: NgxSeo = {\n  meta: {\n    customTags: {\n      mySpecial: {\n        name: 'mySpecial',\n        content: 'mySpecial content :P',\n      },\n    },\n  },\n};\n\nconst routes: Routes = [\n  { path: 'special', component: SpecialComponent, data: { seo: SEO_SPECIAL } },\n];\n```\n\n### Update Title and Meta Tags Dynamically\n\nYou can also to use the service `NgxSeoService` to dynamically update title or meta tags.\n\n```ts\n...\nexport class MoiveDetailComponent implements OnInit {\n  movie: Movie;\n\n  constructor(\n    private movieService: MovieService,\n    private ngxSeoService: NgxSeoService,\n  ) {}\n\n  ngOnInit(): void {\n    this.movieService.getDetails(1).subscribe(movie =\u003e {\n      this.movie = movie;\n\n      this.ngxSeoService.setSeo({\n        title: movie.title,\n        meta: {\n          description: movie.description,\n        },\n      });\n    });\n  }\n}\n```\n\n## API\n\n### NgxSeoModule\n\n#### NgxSeoModule.forRoot(config: NgxSeoConfig)\n\n```ts\n...\nNgxSeoModule.forRoot({\n  changeTitle: (title) =\u003e title,\n  preserve: false,\n  listenToRouteEvents: true,\n})\n...\n```\n\n### NgxSeoService\n\n#### NgxSeoService.setSeo(seo: NgxSeo): void\n\nUpdate SEO title and meta tags.\n\n#### NgxSeoService.setTitle(title: string): void\n\nUpdate SEO title.\n\n#### NgxSeoService.setMeta(meta: NgxSeoMeta): void\n\nUpdate SEO meta tags.\n\n#### NgxSeoService.setMetaKeywords(metaKeywords: string | string[]): void\n\nUpdate meta tag keywords.\n\n#### NgxSeoService.setMetaDescription(metaDescription: string): void\n\nUpdate meta tag description.\n\n#### NgxSeoService.setMetaType(metaType: string): void\n\nUpdate meta tag type.\n\n#### NgxSeoService.setMetaCard(metaCard: string): void\n\nUpdate meta tag card.\n\n#### NgxSeoService.setMetaImage(metaImage: string): void\n\nUpdate meta tag image.\n\n#### NgxSeoService.setMetaUrl(metaUrl: string): void\n\nUpdate meta tag url.\n\n#### NgxSeoService.setMetaAuthor(metaAuthor: string): void\n\nUpdate meta tag author.\n\n#### NgxSeoService.setMetaSiteName(metaSiteName: string): void\n\nUpdate meta tag site name.\n\n#### NgxSeoService.setMetaCanonical(metaCanonical: string): void\n\nUpdate meta tag canonical.\n\n#### NgxSeoService.setMetaCustomTags(customTags: MetaDefinition[]): void\n\nUpdate custom meta tags.\n\n#### NgxSeoService.removeMeta(): void\n\nWill remove all meta tags from HTML document.\n\n# License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favivharuzi%2Fngx-seo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favivharuzi%2Fngx-seo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favivharuzi%2Fngx-seo/lists"}