{"id":22472603,"url":"https://github.com/jcarrano/insta-gallery","last_synced_at":"2025-03-27T16:23:02.632Z","repository":{"id":232371194,"uuid":"733120989","full_name":"jcarrano/insta-gallery","owner":"jcarrano","description":"Display your Instagram Gallery on your website using Cloudflare Workers. No expensive 3rd party services.","archived":false,"fork":false,"pushed_at":"2024-04-09T11:03:33.000Z","size":17,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T20:11:35.819Z","etag":null,"topics":["cloudflare-workers","instagram","instagram-gallery","lightbox"],"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/jcarrano.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}},"created_at":"2023-12-18T15:57:41.000Z","updated_at":"2024-02-10T14:53:34.000Z","dependencies_parsed_at":"2024-04-09T14:16:07.641Z","dependency_job_id":"1cef346a-0367-4274-b7ed-f0ad855f6959","html_url":"https://github.com/jcarrano/insta-gallery","commit_stats":null,"previous_names":["jcarrano/insta-gallery"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarrano%2Finsta-gallery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarrano%2Finsta-gallery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarrano%2Finsta-gallery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcarrano%2Finsta-gallery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcarrano","download_url":"https://codeload.github.com/jcarrano/insta-gallery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245879589,"owners_count":20687406,"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":["cloudflare-workers","instagram","instagram-gallery","lightbox"],"created_at":"2024-12-06T12:16:32.336Z","updated_at":"2025-03-27T16:23:02.606Z","avatar_url":"https://github.com/jcarrano.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instagram Gallery View\n\n## Problem Statement\n\nYou have an Instagram account and you want to also display your images/videos\non your website.\n\n## Solution\n\nThis is a server-side application that produces a gallery view of an user's\nInstagram wall. It is an alternative to the official Instagram widget, which\ndoes not allow to customize the view and may be blocked by ad-blockers or Firefox's\ntracking protection.\n\nIt is a self-hosted alternative to services such as ElecticBlaze (Mobirise),\ncurator, etc and runs on Cloudflare Workers.\n\n## Limitations\n\nOnly one image is shown per album. This is not hard to change, though.\n\n## License and attribution\n\nThis project is licensed under the MIT license.\n\npoptrox belongs to user n33 (also MIT license).\nAll other code is Copyright (C) 2023 Juan Ignacio Carrano.\n\n## How it works\n\n### Instagram API\n\nYou will need to get a app ID and secret from Instagram. You can do so by\ncreating a new app at https://www.instagram.com/developer/clients/manage/\n\nFollow the guide at https://sites.caltech.edu/documents/15223/Setup_Instagram_Basic_Display_API.pdf\nand make sure to use the App Id and App Secret fron the \"Instagram Basic Display API\",\nnot the Facebook App.\n\nAdd your domain to the allowed domains list for authentication.\n\n### Cloudflare Workers\n\n#### Workers KV\n\nYou will need to create a new Workers KV namespace and bind it to your worker\nas `INSTA_GALLERY`. The following keys will be set by the worker:\n\n- `instagram-access-token`: The long-lived access token\n- `instagram-user-id`: The user ID of the Instagram user\n- `auth-state`: The state of the authentication process (temporary)\n\n#### R2 Storage\n\nYou will need to create a new R2 storage namespace and bind it to your worker\nas `INSTA_GALLERY_R2`.\n\nSet the R2 storage to be publicly readable if you want to render the gallery\nclient-side and add your domain to the CORS list.\n\n#### Environment variables\n\nThe following environment variables should be set:\n\n- `INSTAGRAM_APP_ID`: The Instagram app ID.\n- `R2_BUCKET_BASE`: (optional) The base URL for the R2 storage bucket. This is\n  only used for the basic gallery renderer (the one that is served by the worker).\n\nThe following environment variables must be set as secrets:\n\n- `INSTAGRAM_APP_SECRET`: The Instagram app secret.\n- `GALLERY_CONFIG_KEY`: a random string used to perform privileged operations\n  (authentication and forced update).\n\n#### Worker\n\nThe worker is composed of the following paths, plus a scheduled worker:\n\n- `/auth`: serves as a redirect target for Instagram's OAuth flow.\n- `/`: Authentication entry point.\n- `/gallery`: Simplified gallery view.\n- `/update`: Force an update of the gallery.\n- Update handler: Updates the gallery (run as a scheduled worker).\n\nIn order to authenticate and force an update, you will need provide the config\nkey.\n\n#### Set up\n\nUpdate the `wrangler.toml` file with your app ID and, name of the worker, KV\nnamespace and R2 storage namespace.\n\nSet the INSTAGRAM_APP_SECRET secret and choose a random string for\nGALLERY_CONFIG_KEY.\n\nTo start the authentication flow, visit `/` and following the instructions.\n\n#### Update the gallery\n\n`wrangler.toml` contains a scheduled worker that will update the gallery every\nday at 04:30 UTC. You can change the schedule by editing the corresponding\nline.\n\n### Rendering the gallery\n\nThe worker exposes a very basic gallery renderer. For more advanced use cases,\nwrite your own renderer and access the data directly from R2.\n\nSee the client-side renderer in `example_renderer/`. It uses poptrox to display\nthe images and videos in a lightbox.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcarrano%2Finsta-gallery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcarrano%2Finsta-gallery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcarrano%2Finsta-gallery/lists"}