{"id":14959196,"url":"https://github.com/notrab/stripe-astro-loader","last_synced_at":"2025-05-02T12:31:18.735Z","repository":{"id":253302733,"uuid":"843113141","full_name":"notrab/stripe-astro-loader","owner":"notrab","description":"Fetch data from the Stripe API and use it in Astro collections","archived":false,"fork":false,"pushed_at":"2025-04-28T08:31:52.000Z","size":227,"stargazers_count":32,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-28T09:55:12.895Z","etag":null,"topics":["astro","astro-integration","stripe"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notrab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-08-15T20:08:05.000Z","updated_at":"2025-02-11T20:02:05.000Z","dependencies_parsed_at":"2024-08-15T21:13:27.897Z","dependency_job_id":"a25f39d4-ddf7-4171-b5c0-ceb4e271a7ac","html_url":"https://github.com/notrab/stripe-astro-loader","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.375,"last_synced_commit":"3bf587ec35763f765feac5c8089862ef5741506e"},"previous_names":["notrab/stripe-astro-loader"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fstripe-astro-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fstripe-astro-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fstripe-astro-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fstripe-astro-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notrab","download_url":"https://codeload.github.com/notrab/stripe-astro-loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252038135,"owners_count":21684630,"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":["astro","astro-integration","stripe"],"created_at":"2024-09-24T13:19:05.093Z","updated_at":"2025-05-02T12:31:18.730Z","avatar_url":"https://github.com/notrab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stripe-astro-loader\n\nFetch data from the Stripe API and use it in Astro collections \u0026mdash; only has **products** for now.\n\n## Install\n\n```bash\nnpm i stripe stripe-astro-loader\n```\n\n## Configure\n\n```ts\nimport { defineCollection } from \"astro:content\";\nimport { stripePriceLoader, stripeProductLoader } from \"stripe-astro-loader\";\nimport Stripe from \"stripe\";\n\nconst stripe = new Stripe(\"SECRET_KEY\");\n\nconst products = defineCollection({\n  loader: stripeProductLoader(stripe),\n});\n\nconst prices = defineCollection({\n  loader: stripePriceLoader(stripe),\n});\n\nexport const collections = { products, prices };\n```\n\nMake sure to enable the experimental content layer in your Astro config:\n\n```ts\nimport { defineConfig } from \"astro/config\";\n\nexport default defineConfig({\n  experimental: {\n    contentLayer: true,\n  },\n});\n```\n\n## Usage\n\n```astro\n// pages/index.astro\n---\nimport { getCollection } from 'astro:content';\n\nconst products = await getCollection('products');\n---\n```\n\n```astro\n// pages/products/[id].astro\n---\nimport { getCollection,render } from 'astro:content';\n\nexport async function getStaticPaths() {\n  const products = await getCollection('products');\n\n  return products.map(product =\u003e ({\n    params: { id: product.id }, props: { product },\n  }));\n}\n\nconst { product } = Astro.props;\nconst { Content, headings } = await render(product);\n---\n\n\u003ch1\u003e{product.data.name}\u003c/h1\u003e\n\n\u003cpre\u003e{JSON.stringify({product, headings}, null, 2)}\u003c/pre\u003e\n\n\u003cContent /\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotrab%2Fstripe-astro-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotrab%2Fstripe-astro-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotrab%2Fstripe-astro-loader/lists"}