{"id":18375821,"url":"https://github.com/apideck-libraries/file-picker-js","last_synced_at":"2025-09-11T06:33:40.306Z","repository":{"id":65695995,"uuid":"596527481","full_name":"apideck-libraries/file-picker-js","owner":"apideck-libraries","description":"Apideck FilePicker Modal for JavaScript projects","archived":false,"fork":false,"pushed_at":"2023-02-03T10:12:28.000Z","size":776,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-01T03:45:56.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/apideck-libraries.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}},"created_at":"2023-02-02T11:34:56.000Z","updated_at":"2023-02-06T13:22:06.000Z","dependencies_parsed_at":"2023-02-18T05:46:02.118Z","dependency_job_id":null,"html_url":"https://github.com/apideck-libraries/file-picker-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/apideck-libraries/file-picker-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Ffile-picker-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Ffile-picker-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Ffile-picker-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Ffile-picker-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apideck-libraries","download_url":"https://codeload.github.com/apideck-libraries/file-picker-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Ffile-picker-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274589603,"owners_count":25312971,"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-09-11T02:00:13.660Z","response_time":74,"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":[],"created_at":"2024-11-06T00:20:34.521Z","updated_at":"2025-09-11T06:33:40.278Z","avatar_url":"https://github.com/apideck-libraries.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FilePicker JS\n\nA vanilla JavaScript library to embed the [Apideck FilePicker](https://www.apideck.com/samples/file-picker) in any web application.\n\n\u003cimg src=\"./screenshot.png\" width=\"100%\" /\u003e\n\n**FilePicker JS** | [React FilePicker](https://github.com/apideck-libraries/file-picker) | [Vue FilePicker](https://github.com/apideck-libraries/vue-file-picker)\n\n## Installation\n\n### Package\n\n```sh\nnpm install @apideck/file-picker-js\n```\n\n### Script\n\nIf you don't want to set up a build environment, you can get `@apideck/file-picker-js` from a CDN like unpkg.com and it will be globally available through the `window.FilePicker` object.\n\n```html\n\u003cscript src=\"https://unpkg.com/@apideck/file-picker-js\"\u003e\u003c/script\u003e\n```\n\n## Prerequisites\n\nBefore opening the FilePicker modal with `@apideck/file-picker-js`, you need to create a Vault session from your backend using the Vault API or one of our [SDKs](https://docs.apideck.com/sdks). Find out more in the [docs](https://docs.apideck.com/apis/vault/reference#operation/sessionsCreate).\n\n## Usage\n\nPass the JWT you got from the Vault session to `@apideck/file-picker-js` and provide an `onSelect` function that acts upon selection of a file:\n\n```js\nimport { FilePicker } from '@apideck/file-picker-js';\n\nFilePicker.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n  onSelect: file =\u003e console.log(file),\n});\n```\n\nIf you want to get notified when the modal opens and closes, you can provide the `onReady` and `onClose` options. You could also get notified when the consumer switches from integration by using the `onConnectionSelect` option.\n\n```jsx\nimport { FilePicker } from '@apideck/file-picker-js';\n\nFilePicker.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n  onSelect: file =\u003e console.log(file),\n  onClose: () =\u003e {\n    console.log('closed!');\n  },\n  onReady: () =\u003e {\n    console.log('ready!');\n  },\n  onConnectionSelect: connection =\u003e {\n    console.log(connection);\n  },\n});\n```\n\nYou can also provide a file through the `fileToSave` options that will force the FilePicker to go into \"Upload\" mode. This will allow the user to select the connector and folder that the file needs to get saved to.\n\n```jsx\nimport { FilePicker } from '@apideck/file-picker-js';\n\nFilePicker.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n  fileToSave: '\u003cadd-file-here\u003e',\n});\n```\n\n### Properties\n\n| Property           | Type    | Required | Default             | Description                                                           |\n| ------------------ | ------- | -------- | ------------------- | --------------------------------------------------------------------- |\n| token              | string  | true     | -                   | The JSON Web Token returned from the Create Session call              |\n| onSelect           | event   | false    | -                   | The function that gets called when a file is selected                 |\n| onConnectionSelect | event   | false    | -                   | The function that gets called when a connection is selected           |\n| title              | string  | false    | Apideck File Picker | Title shown in the modal                                              |\n| subTitle           | string  | false    | Select a file       | Subtitle shown in the modal                                           |\n| showAttribution    | boolean | false    | true                | Show \"Powered by Apideck\" in the backdrop of the modal backdrop       |\n| open               | boolean | false    | false               | Opens the file picker if set to true                                  |\n| onClose            | event   | false    | -                   | Function that gets called when the modal is closed                    |\n| fileToSave         | file    | false    | -                   | Forces \"Upload\" mode to select the folder to upload the provided file |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapideck-libraries%2Ffile-picker-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapideck-libraries%2Ffile-picker-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapideck-libraries%2Ffile-picker-js/lists"}