{"id":26722978,"url":"https://github.com/useallfive/angular-contentful-service","last_synced_at":"2025-04-14T06:55:30.568Z","repository":{"id":140208839,"uuid":"108497389","full_name":"UseAllFive/angular-contentful-service","owner":"UseAllFive","description":"A contentful.js wrapper for Angular w/ request caching","archived":false,"fork":false,"pushed_at":"2021-11-12T22:32:40.000Z","size":279,"stargazers_count":16,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T06:55:25.774Z","etag":null,"topics":["angular","contentful","contentful-js-sdk"],"latest_commit_sha":null,"homepage":"https://goo.gl/j58FoJ","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/UseAllFive.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":"2017-10-27T03:58:29.000Z","updated_at":"2024-05-29T22:32:05.000Z","dependencies_parsed_at":"2025-03-27T20:38:35.262Z","dependency_job_id":null,"html_url":"https://github.com/UseAllFive/angular-contentful-service","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fangular-contentful-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fangular-contentful-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fangular-contentful-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fangular-contentful-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UseAllFive","download_url":"https://codeload.github.com/UseAllFive/angular-contentful-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837281,"owners_count":21169374,"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","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","contentful","contentful-js-sdk"],"created_at":"2025-03-27T20:38:29.725Z","updated_at":"2025-04-14T06:55:30.558Z","avatar_url":"https://github.com/UseAllFive.png","language":"TypeScript","readme":"[![GitHub release](https://img.shields.io/github/release/UseAllFive/angular-contentful-service.svg)]() [![GitHub license](https://img.shields.io/github/license/UseAllFive/angular-contentful-service.svg)](https://github.com/UseAllFive/angular-contentful-service) [![GitHub issues](https://img.shields.io/github/issues/UseAllFive/angular-contentful-service.svg)](https://github.com/UseAllFive/angular-contentful-service/issues) [![Twitter](https://img.shields.io/twitter/url/https/github.com/UseAllFive/angular-contentful-service.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2FUseAllFive%2Fangular-contentful-service)\n\n# Angular Contentful Service\n\nA [contentful.js](https://github.com/contentful/contentful.js/) wrapper for [Angular](http://angular.io) that makes our lives just a bit easier. Also, requests to the Contentful API are cached for improved performance!\n\n## Installation\n\n### Install with NPM\n\n```\nnpm i --save angular-contentful-service\n```\n\n### Install contentful\n\nIf you haven't already, make sure you install contentful\n\n```\nnpm i --save contentful\n```\n\n### Add to your app module\n\n```typescript\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\nimport { AppComponent } from './app.component';\nimport { ContentfulModule } from 'angular-contentful-service';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    ContentfulModule.forRoot({\n      space: 'yadj1kx9rmg0', // your space ID\n      accessToken: 'fdb4e7a3102747a02ea69ebac5e282b9e44d28fb340f778a4f5e788625a61abe', // your access token\n    }),\n  ],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n```\n\n### Use the Contentful Service\n\n```typescript\nimport { Component } from '@angular/core';\nimport { ContentfulService } from 'angular-contentful-service'\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n\n  constructor(private cs: ContentfulService) {}\n\n  getEntries(query?: any) {\n    this.cs.getEntries(query).then(res =\u003e console.log(res));\n  }\n\n  getEntry(id: string, query?: any) {\n    this.cs.getEntry(id, query).then(res =\u003e console.log(res));\n  }\n}\n```\n\n## Configuration options\n\n```typescript\n{\n  space: string;\n  accessToken: string;\n  insecure?: boolean;\n  host?: string;\n  basePath?: string;\n  httpAgent?: any;\n  httpsAgent?: any;\n  proxy?: {\n    host: string;\n    port?: number;\n    auth?: {\n      username: string;\n      password: string;\n    };\n  };\n  headers?: any;\n  application?: string;\n  integration?: string;\n  resolveLinks?: boolean;\n  retryOnError?: boolean;\n}\n```\n\n## Service methods\n\n### getEntries()\n\nReturn all entries filtered by Contentful query\n\n```typescript\ngetEntries(query?: any): Promise\u003cEntryCollection\u003cany\u003e\u003e\n```\n\nInformation on `EntryCollection` type found here: https://github.com/contentful/contentful.js/blob/master/index.d.ts#L34\n\nExample:\n\n```typescript\nthis.cs.getEntries({include: 2});\n```\n\n### getEntry()\n\nReturn a single entry object based on `id` and optional `query` params\n\n```typescript\ngetEntry(id: string, query?: any): Promise\u003cEntry\u003cany\u003e\u003e\n```\n\nInformation on `Entry` type found here: https://github.com/contentful/contentful.js/blob/master/index.d.ts#L65\n\nExample:\n\n```typescript\nthis.cs.getEntry('3xd57HfJlSM2qmm8C6cueK', {include: 2})\n```\n\n## Contribute\n\nPlease feel free to contribute to this repository. To do so, simply clone this repository and run `ng serve` to get the project working locally.\n\n## Brought to you by\n\n[![Use All Five](https://avatars0.githubusercontent.com/u/1775836?s=75\u0026v=4)](http://useallfive.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseallfive%2Fangular-contentful-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuseallfive%2Fangular-contentful-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseallfive%2Fangular-contentful-service/lists"}