{"id":13619680,"url":"https://github.com/umutzd/data-provider-customizer","last_synced_at":"2026-02-17T21:45:35.820Z","repository":{"id":38308074,"uuid":"434692228","full_name":"umutzd/data-provider-customizer","owner":"umutzd","description":"Supercharge the data of your refine app! Get data from anywhere. Customize your data provider by mixing it with different data providers/data methods.","archived":false,"fork":false,"pushed_at":"2023-01-31T13:10:27.000Z","size":954,"stargazers_count":24,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-20T22:03:37.778Z","etag":null,"topics":["admin-panel","customization","data-provider","react","refine"],"latest_commit_sha":null,"homepage":"","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/umutzd.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}},"created_at":"2021-12-03T18:14:45.000Z","updated_at":"2024-06-26T18:07:06.000Z","dependencies_parsed_at":"2023-02-15T09:30:50.003Z","dependency_job_id":null,"html_url":"https://github.com/umutzd/data-provider-customizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutzd%2Fdata-provider-customizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutzd%2Fdata-provider-customizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutzd%2Fdata-provider-customizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutzd%2Fdata-provider-customizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umutzd","download_url":"https://codeload.github.com/umutzd/data-provider-customizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223638123,"owners_count":17177745,"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":["admin-panel","customization","data-provider","react","refine"],"created_at":"2024-08-01T21:00:46.889Z","updated_at":"2026-02-17T21:45:30.794Z","avatar_url":"https://github.com/umutzd.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":["Community Packages ❤️"],"readme":"# data-provider-customizer\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/db7039142c874076a63b46851a92f998)](https://www.codacy.com/gh/miyavsu-limited/data-provider-customizer/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=miyavsu-limited/data-provider-customizer\u0026amp;utm_campaign=Badge_Grade) ![Codacy coverage](https://img.shields.io/codacy/coverage/db7039142c874076a63b46851a92f998) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/data-provider-customizer@latest) \n\nWith this tool, you can customize your [refine][refine] [data providers][data-provider] per resource. You can use different data providers for different resources, override one method for just one specific resource etc. \n\nIf you have a non-standard API or some endpoint that refine should hit and your data provider methods don't work for that endpoint, you can use this tool to override a method for that resource. \n\n```ts\nfunction customize(source: DataProvider, customizations?: CustomizationsType): DataProvider\n```\n\n`customize` function accepts a data provider and a customization configuration. Returns a data provider.\n\n## Examples\n\n### Specific override\n\n```ts\nexport const dataProvider = customize(baseDataProvider, {\n  posts: {\n    getOne: () =\u003e {\n      // specific getOne implementation ...\n    }\n  },\n});\n\n// baseDataProvider.getOne (not \"posts\")\ndataProvider.getOne({ resource: \"foo\", ... }); \n\n// customized getOne (\"posts\" override)\ndataProvider.getOne({ resource: \"posts\", ... });\n```\n\nAny invocation of any method of `dataProvider` triggers the same method in `baseDataProvider` except if the resource is \"posts\" for `getOne` method. If `getOne` method of `dataProvider` is invoked, for \"posts\" resource, the customized method runs.\n\n### Different data provider for a resource\n\n```ts\nexport const dataProvider = customize(baseDataProvider, {\n  posts: supabaseDataProvider,\n  categories: supabaseDataProvider,\n});\n\n\n// baseDataProvider.getOne (no overrides for \"foo\")\ndataProvider.getOne({ resource: \"foo\", ... }); \n\n// supabaseDataProvider.getOne (\"posts\" override)\ndataProvider.getOne({ resource: \"posts\", ... });\n\n// supabaseDataProvider.getOne (\"categories\" override)\ndataProvider.getOne({ resource: \"categories\", ... });\n```\n\nIn this example, `posts` and `categories` resources use a different data provider: `supabaseDataProvider`. Any request that is invoked for \"posts\" and \"categories\" goes through `supabasedataProvider`. Rest goes for `baseDataProvider`.\n\n### Advanced Customization\n\n```ts\nexport const dataProvider = customize(baseDataProvider, {\n  posts: supabaseDataProvider,\n  categories: customize(supabaseDataProvider, {\n    categories: {\n      getMany: () =\u003e {\n        // specific getMany implementation ...\n      }\n    }\n  }),\n});\n\n// baseDataProvider.getOne (no overrides)\ndataProvider.getOne({ resource: \"foo\", ... }); \n\n// supabaseDataProvider.getOne (for \"categories\")\ndataProvider.getOne({ resource: \"categories\", ... }); \n\n// specific getMany implementation (for \"categories\")\ndataProvider.getMany({ resource: \"categories\", ... }); \n```\n\nIn this example all requests except for \"posts\" and \"categories\" are made through `baseDataProvider`. \"posts\" and \"categories\" resources use `supabaseDataProvider`. There is one exception: `getMany` method for \"categories\" resource goes through the user defined method.\n\n## Run tests\n\nJest tests are set up to run with `npm test`.\n\n[refine]: https://refine.dev/\n[data-provider]: https://refine.dev/docs/api-references/providers/data-provider/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutzd%2Fdata-provider-customizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumutzd%2Fdata-provider-customizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutzd%2Fdata-provider-customizer/lists"}