{"id":23131188,"url":"https://github.com/friendlycaptcha/friendly-stripe-sync","last_synced_at":"2025-08-17T08:31:06.101Z","repository":{"id":176582866,"uuid":"614454700","full_name":"FriendlyCaptcha/friendly-stripe-sync","owner":"FriendlyCaptcha","description":"Sync your Stripe data to your Postgres database","archived":false,"fork":false,"pushed_at":"2025-06-30T12:14:55.000Z","size":150,"stargazers_count":17,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T00:25:54.835Z","etag":null,"topics":["postgres","postgresql","stripe","sync"],"latest_commit_sha":null,"homepage":"","language":"Go","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/FriendlyCaptcha.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":"2023-03-15T16:05:08.000Z","updated_at":"2025-07-14T11:23:56.000Z","dependencies_parsed_at":"2024-12-17T11:12:22.291Z","dependency_job_id":"9d60afbe-474b-4833-9d49-f25803e6f666","html_url":"https://github.com/FriendlyCaptcha/friendly-stripe-sync","commit_stats":null,"previous_names":["friendlycaptcha/friendly-stripe-sync"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/FriendlyCaptcha/friendly-stripe-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-stripe-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-stripe-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-stripe-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-stripe-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendlyCaptcha","download_url":"https://codeload.github.com/FriendlyCaptcha/friendly-stripe-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-stripe-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270822838,"owners_count":24651997,"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-17T02:00:09.016Z","response_time":129,"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":["postgres","postgresql","stripe","sync"],"created_at":"2024-12-17T11:12:15.771Z","updated_at":"2025-08-17T08:31:05.753Z","avatar_url":"https://github.com/FriendlyCaptcha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# friendly-stripe-sync\n\nLoad and periodically synchronize data from Stripe to a Postgres database.\n\n## How it works\n\n1. Creates a schema called `stripe` in the postgres database with all the needed tables\n2. Loads the initial data from Stripe and populates the tables\n3. Periodically calls the `/events` endpoint of Stripe to load changes and update the database\n\n### Supported Data Types\n\nfriendly-stripe-sync currently supports products, prices, customers, subscriptions, subscription items, and coupons.  \nThe data is updated using the following events:\n\n- [x] customer.created\n- [x] customer.updated\n- [x] customer.deleted\n- [x] product.created\n- [x] product.updated\n- [x] product.deleted\n- [x] customer.subscription.created\n- [x] customer.subscription.updated\n- [x] customer.subscription.paused\n- [x] customer.subscription.deleted\n- [x] price.created\n- [x] price.updated\n- [x] price.deleted\n\n## Installation\n\n```shell\ngo install github.com/FriendlyCaptcha/friendly-stripe-sync@latest\n```\n\n## Usage\n\n### Setup Database\n\nBefore running the `friendly-stripe-sync` service you will want to migrate your database to create the necessary tables.\n\n```shell\n# Help on all migration-related commands for Postgres\nfriendly-stripe-sync migrate postgres --help\n\n# List all available migrations\nfriendly-stripe-sync migrate postgres list\n\n# List the current migration version\nfriendly-stripe-sync migrate postgres version\n\n# Run all migrations to get up to the latest version\nfriendly-stripe-sync migrate postgres up\n```\n\n### Load the existing Stripe data\n\nTo load the initial dataset (required if you have data older than 30 days in your Stripe account).\n2\n\n```shell\n# --purge will delete all existing data before loading the data from Stripe\nfriendly-stripe-sync load [--purge]\n```\n\n### Synchronize once\n\nTo load recent changes since the initial load you can synchronize once. This will work for changes that are up to 30 days old.\n\n```shell\nfriendly-stripe-sync sync\n```\n\n### Synchronize and watch\n\nIf you want to keep your database up to date you should consider running the synchronization periodically.  \nThis will load the initial data if it hasn't been loaded already and will then synchronize periodically (see configuration).\n\n```shell\n# -i defines how often in seconds it will load changes from Stripe\nfriendly-stripe-sync watch [-i 60]\n```\n\n## Configuration\n\nThe app looks for a configuration file called `.friendly-stripe-sync.yml` in the working directory.\n\n```yaml\n# Sets the log devel to debug and adds more info to the log entires\ndebug: false\n# Makes the log entries human readable instead of JSON\ndevelopment: false\n\nstripe:\n  # You Stripe API key\n  api_key: \"...\"\n\n# Database configuration\npostgres:\n  host: \"localhost\"\n  port: 5432\n  user: \"postgres\"\n  password: \"\"\n  dbname: \"friendlystripe\"\n  sslmode: \"disable\"\n\n# Exclude certain fields from being stored in the database. By default no fields are excluded.\nstripe_sync:\n  excluded_fields:\n    # Currently only the following fields can be excluded:\n    - \"customer.address\"\n    - \"customer.phone\"\n```\n\nYou can also set config fields using environment variables. The app will look for environment variables starting with `FSS_`. For example `FSS_POSTGRES__PASSWORD=1234567890` will overwrite the `postgres.password` field in the YAML config.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-stripe-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendlycaptcha%2Ffriendly-stripe-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-stripe-sync/lists"}