{"id":42102108,"url":"https://github.com/Cap-go/capacitor-photo-library","last_synced_at":"2026-02-05T13:00:49.696Z","repository":{"id":317850975,"uuid":"1069032453","full_name":"Cap-go/capacitor-photo-library","owner":"Cap-go","description":"Capacitor plugin Displays photo gallery as web page, or boring native screen which you cannot modify but require no authorization","archived":false,"fork":false,"pushed_at":"2026-01-28T17:43:35.000Z","size":689,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-29T07:37:14.692Z","etag":null,"topics":["capacitor","plugin"],"latest_commit_sha":null,"homepage":"https://capgo.app","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cap-go.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"Cap-go","patreon":null,"open_collective":"capgo","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-10-03T09:47:09.000Z","updated_at":"2026-01-28T17:43:54.000Z","dependencies_parsed_at":"2025-10-03T13:30:35.345Z","dependency_job_id":"153dcb89-2b3f-4fa8-8b37-44d302629685","html_url":"https://github.com/Cap-go/capacitor-photo-library","commit_stats":null,"previous_names":["cap-go/capacitor-photo-library"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/Cap-go/capacitor-photo-library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-photo-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-photo-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-photo-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-photo-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap-go","download_url":"https://codeload.github.com/Cap-go/capacitor-photo-library/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap-go%2Fcapacitor-photo-library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28963271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T00:42:38.011Z","status":"ssl_error","status_checked_at":"2026-02-01T00:42:35.920Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["capacitor","plugin"],"created_at":"2026-01-26T13:00:21.332Z","updated_at":"2026-02-05T13:00:49.689Z","avatar_url":"https://github.com/Cap-go.png","language":"Java","funding_links":["https://github.com/sponsors/Cap-go","https://opencollective.com/capgo"],"categories":["Capgo Capacitor Plugins","[Capgo plugins](https://capgo.app/)"],"sub_categories":["Camera \u0026 Media"],"readme":"# @capgo/capacitor-photo-library\n \u003ca href=\"https://capgo.app/\"\u003e\u003cimg src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/?ref=plugin_photo_library\"\u003e ➡️ Get Instant updates for your App with Capgo\u003c/a\u003e\u003c/h2\u003e\n  \u003ch2\u003e\u003ca href=\"https://capgo.app/consulting/?ref=plugin_photo_library\"\u003e Missing a feature? We’ll build the plugin for you 💪\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\nDisplays photo gallery as web page, or boring native screen which you cannot modify but require no authorization\n\n## Documentation\n\nThe most complete doc is available here: https://capgo.app/docs/plugins/photo-library/\n\n## Compatibility\n\n| Plugin version | Capacitor compatibility | Maintained |\n| -------------- | ----------------------- | ---------- |\n| v8.\\*.\\*       | v8.\\*.\\*                | ✅          |\n| v7.\\*.\\*       | v7.\\*.\\*                | On demand   |\n| v6.\\*.\\*       | v6.\\*.\\*                | ❌          |\n| v5.\\*.\\*       | v5.\\*.\\*                | ❌          |\n\n\u003e **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.\n\n## Install\n\n```bash\nnpm install @capgo/capacitor-photo-library\nnpx cap sync\n```\n\n## Usage\n\n```ts\nimport { Capacitor } from '@capacitor/core';\nimport { PhotoLibrary } from '@capgo/capacitor-photo-library';\n\nconst { state } = await PhotoLibrary.requestAuthorization();\nif (state === 'authorized' || state === 'limited') {\n  const { assets, hasMore } = await PhotoLibrary.getLibrary({\n    limit: 100,\n    thumbnailWidth: 256,\n    thumbnailHeight: 256,\n  });\n\n  const gallery = assets.map(asset =\u003e ({\n    id: asset.id,\n    fileName: asset.fileName,\n    thumbnailUrl: asset.thumbnail\n      ? asset.thumbnail.webPath ?? Capacitor.convertFileSrc(asset.thumbnail.path)\n      : undefined,\n    photoUrl: asset.file\n      ? asset.file.webPath ?? Capacitor.convertFileSrc(asset.file.path)\n      : undefined,\n  }));\n\n  console.log('Loaded', gallery.length, 'items. More available?', hasMore);\n}\n\nconst picked = await PhotoLibrary.pickMedia({\n  selectionLimit: 3,\n  includeVideos: true,\n});\n\nconsole.log('User selected', picked.assets.length, 'items');\n```\n\nThe native implementations cache exported files inside the application cache\ndirectory. You can safely delete the `photoLibrary` folder under the cache if\nyou need to free up space.\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`checkAuthorization()`](#checkauthorization)\n* [`requestAuthorization()`](#requestauthorization)\n* [`getAlbums()`](#getalbums)\n* [`getLibrary(...)`](#getlibrary)\n* [`getPhotoUrl(...)`](#getphotourl)\n* [`getThumbnailUrl(...)`](#getthumbnailurl)\n* [`pickMedia(...)`](#pickmedia)\n* [`getPluginVersion()`](#getpluginversion)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\n### checkAuthorization()\n\n```typescript\ncheckAuthorization() =\u003e Promise\u003c{ state: PhotoLibraryAuthorizationState; }\u003e\n```\n\nReturns the current authorization status without prompting the user.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ state: \u003ca href=\"#photolibraryauthorizationstate\"\u003ePhotoLibraryAuthorizationState\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### requestAuthorization()\n\n```typescript\nrequestAuthorization() =\u003e Promise\u003c{ state: PhotoLibraryAuthorizationState; }\u003e\n```\n\nRequests access to the photo library if needed.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ state: \u003ca href=\"#photolibraryauthorizationstate\"\u003ePhotoLibraryAuthorizationState\u003c/a\u003e; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getAlbums()\n\n```typescript\ngetAlbums() =\u003e Promise\u003c{ albums: PhotoLibraryAlbum[]; }\u003e\n```\n\nRetrieves the available albums.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ albums: PhotoLibraryAlbum[]; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getLibrary(...)\n\n```typescript\ngetLibrary(options?: GetLibraryOptions | undefined) =\u003e Promise\u003cGetLibraryResult\u003e\n```\n\nRetrieves library assets along with URLs that can be displayed in the web view.\n\n| Param         | Type                                                            |\n| ------------- | --------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#getlibraryoptions\"\u003eGetLibraryOptions\u003c/a\u003e\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#getlibraryresult\"\u003eGetLibraryResult\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getPhotoUrl(...)\n\n```typescript\ngetPhotoUrl(options: { id: string; }) =\u003e Promise\u003cPhotoLibraryFile\u003e\n```\n\nRetrieves a displayable URL for the full resolution version of the asset.\nIf you already called `getLibrary` with `includeFullResolutionData`, you normally\ndo not need this method.\n\n| Param         | Type                         |\n| ------------- | ---------------------------- |\n| **`options`** | \u003ccode\u003e{ id: string; }\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#photolibraryfile\"\u003ePhotoLibraryFile\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getThumbnailUrl(...)\n\n```typescript\ngetThumbnailUrl(options: { id: string; width?: number; height?: number; quality?: number; }) =\u003e Promise\u003cPhotoLibraryFile\u003e\n```\n\nRetrieves a displayable URL for a resized thumbnail of the asset.\n\n| Param         | Type                                                                            |\n| ------------- | ------------------------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e{ id: string; width?: number; height?: number; quality?: number; }\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#photolibraryfile\"\u003ePhotoLibraryFile\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### pickMedia(...)\n\n```typescript\npickMedia(options?: PickMediaOptions | undefined) =\u003e Promise\u003cPickMediaResult\u003e\n```\n\nOpens the native system picker so the user can select media without granting full photo library access.\nThe selected files are copied into the application cache and returned with portable URLs.\n\n| Param         | Type                                                          |\n| ------------- | ------------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#pickmediaoptions\"\u003ePickMediaOptions\u003c/a\u003e\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#pickmediaresult\"\u003ePickMediaResult\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### getPluginVersion()\n\n```typescript\ngetPluginVersion() =\u003e Promise\u003c{ version: string; }\u003e\n```\n\nGet the native Capacitor plugin version\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;{ version: string; }\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### Interfaces\n\n\n#### PhotoLibraryAlbum\n\n| Prop             | Type                |\n| ---------------- | ------------------- |\n| **`id`**         | \u003ccode\u003estring\u003c/code\u003e |\n| **`title`**      | \u003ccode\u003estring\u003c/code\u003e |\n| **`assetCount`** | \u003ccode\u003enumber\u003c/code\u003e |\n\n\n#### GetLibraryResult\n\n| Prop             | Type                             | Description                                                                                                                    |\n| ---------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| **`assets`**     | \u003ccode\u003ePhotoLibraryAsset[]\u003c/code\u003e |                                                                                                                                |\n| **`totalCount`** | \u003ccode\u003enumber\u003c/code\u003e              | Total number of assets matching the query in the library. `assets.length` can be less than this value when pagination is used. |\n| **`hasMore`**    | \u003ccode\u003eboolean\u003c/code\u003e             | Whether more assets are available when using pagination.                                                                       |\n\n\n#### PhotoLibraryAsset\n\n| Prop                   | Type                                                          | Description                                                              |\n| ---------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------ |\n| **`id`**               | \u003ccode\u003estring\u003c/code\u003e                                           |                                                                          |\n| **`fileName`**         | \u003ccode\u003estring\u003c/code\u003e                                           |                                                                          |\n| **`type`**             | \u003ccode\u003e\u003ca href=\"#photoassettype\"\u003ePhotoAssetType\u003c/a\u003e\u003c/code\u003e     |                                                                          |\n| **`width`**            | \u003ccode\u003enumber\u003c/code\u003e                                           |                                                                          |\n| **`height`**           | \u003ccode\u003enumber\u003c/code\u003e                                           |                                                                          |\n| **`duration`**         | \u003ccode\u003enumber\u003c/code\u003e                                           |                                                                          |\n| **`creationDate`**     | \u003ccode\u003estring\u003c/code\u003e                                           |                                                                          |\n| **`modificationDate`** | \u003ccode\u003estring\u003c/code\u003e                                           |                                                                          |\n| **`latitude`**         | \u003ccode\u003enumber\u003c/code\u003e                                           |                                                                          |\n| **`longitude`**        | \u003ccode\u003enumber\u003c/code\u003e                                           |                                                                          |\n| **`mimeType`**         | \u003ccode\u003estring\u003c/code\u003e                                           |                                                                          |\n| **`size`**             | \u003ccode\u003enumber\u003c/code\u003e                                           | Size in bytes reported by the OS for the underlying asset, if available. |\n| **`albumIds`**         | \u003ccode\u003estring[]\u003c/code\u003e                                         |                                                                          |\n| **`thumbnail`**        | \u003ccode\u003e\u003ca href=\"#photolibraryfile\"\u003ePhotoLibraryFile\u003c/a\u003e\u003c/code\u003e |                                                                          |\n| **`file`**             | \u003ccode\u003e\u003ca href=\"#photolibraryfile\"\u003ePhotoLibraryFile\u003c/a\u003e\u003c/code\u003e |                                                                          |\n\n\n#### PhotoLibraryFile\n\n| Prop           | Type                | Description                                                                                   |\n| -------------- | ------------------- | --------------------------------------------------------------------------------------------- |\n| **`path`**     | \u003ccode\u003estring\u003c/code\u003e | Absolute path on the native file system.                                                      |\n| **`webPath`**  | \u003ccode\u003estring\u003c/code\u003e | URL that can be used inside a web view. Usually produced by `Capacitor.convertFileSrc(path)`. |\n| **`mimeType`** | \u003ccode\u003estring\u003c/code\u003e |                                                                                               |\n| **`size`**     | \u003ccode\u003enumber\u003c/code\u003e | Size in bytes if known, otherwise `-1`.                                                       |\n\n\n#### GetLibraryOptions\n\n| Prop                            | Type                 | Description                                                                                           |\n| ------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------- |\n| **`offset`**                    | \u003ccode\u003enumber\u003c/code\u003e  | Number of assets to skip from the beginning of the query.                                             |\n| **`limit`**                     | \u003ccode\u003enumber\u003c/code\u003e  | Maximum number of assets to return. Omit to return everything that matches.                           |\n| **`includeImages`**             | \u003ccode\u003eboolean\u003c/code\u003e | Include images in the result. Defaults to `true`.                                                     |\n| **`includeVideos`**             | \u003ccode\u003eboolean\u003c/code\u003e | Include videos in the result. Defaults to `false`.                                                    |\n| **`includeAlbumData`**          | \u003ccode\u003eboolean\u003c/code\u003e | Include information about the albums each asset belongs to. Defaults to `false`.                      |\n| **`includeCloudData`**          | \u003ccode\u003eboolean\u003c/code\u003e | Include assets stored in the cloud (iCloud / Google Photos). Defaults to `true`.                      |\n| **`useOriginalFileNames`**      | \u003ccode\u003eboolean\u003c/code\u003e | If `true`, use the original filenames reported by the OS when available.                              |\n| **`thumbnailWidth`**            | \u003ccode\u003enumber\u003c/code\u003e  | Width of the generated thumbnails. Defaults to `512`.                                                 |\n| **`thumbnailHeight`**           | \u003ccode\u003enumber\u003c/code\u003e  | Height of the generated thumbnails. Defaults to `384`.                                                |\n| **`thumbnailQuality`**          | \u003ccode\u003enumber\u003c/code\u003e  | JPEG quality for generated thumbnails (0-1). Defaults to `0.5`.                                       |\n| **`includeFullResolutionData`** | \u003ccode\u003eboolean\u003c/code\u003e | When `true`, copies the full sized asset into the app cache and returns its URL. Defaults to `false`. |\n\n\n#### PickMediaResult\n\n| Prop         | Type                             |\n| ------------ | -------------------------------- |\n| **`assets`** | \u003ccode\u003ePhotoLibraryAsset[]\u003c/code\u003e |\n\n\n#### PickMediaOptions\n\n| Prop                   | Type                 | Description                                                                                         |\n| ---------------------- | -------------------- | --------------------------------------------------------------------------------------------------- |\n| **`selectionLimit`**   | \u003ccode\u003enumber\u003c/code\u003e  | Maximum number of items the user can select. Use `0` to allow unlimited selection. Defaults to `1`. |\n| **`includeImages`**    | \u003ccode\u003eboolean\u003c/code\u003e | Allow the user to select images. Defaults to `true`.                                                |\n| **`includeVideos`**    | \u003ccode\u003eboolean\u003c/code\u003e | Allow the user to select videos. Defaults to `false`.                                               |\n| **`thumbnailWidth`**   | \u003ccode\u003enumber\u003c/code\u003e  | Width of the generated thumbnails for picked items. Defaults to `256`.                              |\n| **`thumbnailHeight`**  | \u003ccode\u003enumber\u003c/code\u003e  | Height of the generated thumbnails for picked items. Defaults to `256`.                             |\n| **`thumbnailQuality`** | \u003ccode\u003enumber\u003c/code\u003e  | JPEG quality for generated thumbnails (0-1). Defaults to `0.7`.                                     |\n\n\n### Type Aliases\n\n\n#### PhotoLibraryAuthorizationState\n\n\u003ccode\u003e'authorized' | 'limited' | 'denied' | 'notDetermined'\u003c/code\u003e\n\n\n#### PhotoAssetType\n\n\u003ccode\u003e'image' | 'video'\u003c/code\u003e\n\n\u003c/docgen-api\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCap-go%2Fcapacitor-photo-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCap-go%2Fcapacitor-photo-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCap-go%2Fcapacitor-photo-library/lists"}