{"id":27293266,"url":"https://github.com/bjoerndotsol/amazon-review-redirect","last_synced_at":"2026-05-11T05:36:18.788Z","repository":{"id":215585395,"uuid":"739309763","full_name":"bjoerndotsol/amazon-review-redirect","owner":"bjoerndotsol","description":"This repository contains a streamlined Firebase Cloud Function that effortlessly directs users to the correct Amazon Store (like amazon.com, amazon.fr, amazon.de, etc.). This function is particularly useful for guiding customers to write reviews on the Amazon Store relevant to their region.","archived":false,"fork":false,"pushed_at":"2024-01-05T09:25:58.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T22:43:35.185Z","etag":null,"topics":["amazon","cloudfunctions","firebase","redirects"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bjoerndotsol.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}},"created_at":"2024-01-05T09:01:12.000Z","updated_at":"2024-01-06T04:20:11.000Z","dependencies_parsed_at":"2024-01-05T09:44:48.578Z","dependency_job_id":null,"html_url":"https://github.com/bjoerndotsol/amazon-review-redirect","commit_stats":null,"previous_names":["bjoentrepreneur/amazon-review-redirect","bjoerndotsol/amazon-review-redirect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bjoerndotsol/amazon-review-redirect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoerndotsol%2Famazon-review-redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoerndotsol%2Famazon-review-redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoerndotsol%2Famazon-review-redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoerndotsol%2Famazon-review-redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjoerndotsol","download_url":"https://codeload.github.com/bjoerndotsol/amazon-review-redirect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoerndotsol%2Famazon-review-redirect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32883466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":["amazon","cloudfunctions","firebase","redirects"],"created_at":"2025-04-11T22:43:33.541Z","updated_at":"2026-05-11T05:36:18.666Z","avatar_url":"https://github.com/bjoerndotsol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redirect Cloud Function for Amazon Ratings\n\nThis repository contains a Firebase Cloud Function designed to perform geographical redirection based on the user's IP address. It's particularly useful for redirecting users to domain-specific pages or services, ensuring that they reach the most relevant content based on their location.\n\nYou can deploy this function and once a user, who bought a book on Amazon clicks on the link, they will be reidrected to the correct Amazon Store (US, DE, FR, ...) based on their IP address or langauge. Default always forwards to amazon.com\n\nTip: Use a QR code so the user can scan even easier.\n\n## Functionality\n\nThe `geoRedirect` function:\n\n- Checks if the domain making the request is allowed.\n- Retrieves the user's IP address.\n- Determines the user's geographical location using the `geoip-lite` library.\n- Redirects the user to a specific URL based on their country, with a fallback to a default domain.\n\n## Setup\n\n### Prerequisites\n\n- Node.js\n- Firebase CLI\n- A Firebase project\n\n### Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/bjoentrepreneur/amazon-review-redirect.git\n   cd amazon-review-redirect\n   ```\n\n2. Navigate to the functions directory:\n\n```bash\n   cd functions\n```\n\n3. Istall dependencies:\n\n```bash\n   npm install\n\n```\n\n### Configuration\n\n- Update the `allowedDomains` array in the `index.js` file to include the domains that are allowed to access this function.\n- Modify the `countryDomainMapping` object to map countries to specific domains as needed.\n\n## Deployment\n\nDeploy the function to Firebase using the following command:\n\n```bash\nfirebase deploy --only functions\n```\n\n## Usage\n\nMake a request to the deployed function's URL with the appropriate headers and query parameters:\n\n- `x-forwarded-for`: User's IP address.\n- `asin`: The Amazon Standard Identification Number.\n- `language`: (Optional) Fallback language parameter.\n\n## Disclaimer\n\nThis project is not affiliated with or endorsed by Amazon or any other domain-specific services used in the function.\n\n## Contributing\n\nContributions, issues, and feature requests are welcome. Feel free to check [Issues](https://github.com/bjoentrepreneur/amazon-review-redirect/issues) if you want to contribute.\n\n## License\n\nMIT\n\n## Contact\n\nFor any queries or contributions, please contact [Björn](https://github.com/bjoentrepreneur)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoerndotsol%2Famazon-review-redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjoerndotsol%2Famazon-review-redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoerndotsol%2Famazon-review-redirect/lists"}