{"id":18375826,"url":"https://github.com/apideck-libraries/vault-js","last_synced_at":"2025-04-06T20:31:14.629Z","repository":{"id":64834771,"uuid":"578523526","full_name":"apideck-libraries/vault-js","owner":"apideck-libraries","description":"Apideck Vault Modal for vanilla JavaScript projects","archived":false,"fork":false,"pushed_at":"2024-06-24T07:30:52.000Z","size":611,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-22T06:27:09.229Z","etag":null,"topics":["apideck","integrations","javascript","vault"],"latest_commit_sha":null,"homepage":"https://www.apideck.com/products/vault","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-15T09:02:53.000Z","updated_at":"2024-06-24T07:30:02.000Z","dependencies_parsed_at":"2024-04-03T18:50:01.638Z","dependency_job_id":null,"html_url":"https://github.com/apideck-libraries/vault-js","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":0.2571428571428571,"last_synced_commit":"cf94caecf26fd2b356acd2199c08d80bd1b1b68a"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fvault-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fvault-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fvault-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fvault-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apideck-libraries","download_url":"https://codeload.github.com/apideck-libraries/vault-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247547330,"owners_count":20956537,"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":["apideck","integrations","javascript","vault"],"created_at":"2024-11-06T00:20:35.783Z","updated_at":"2025-04-06T20:31:14.289Z","avatar_url":"https://github.com/apideck-libraries.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://user-images.githubusercontent.com/8850410/208065819-716c6e02-98c9-4df5-b687-e5acd1e3c4e5.png\" width=\"100%\" /\u003e\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@apideck/vault-js\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@apideck/vault-js.svg\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@apideck/vault-js\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/@apideck/vault-js.svg\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Vault JS\n\nA vanilla JavaScript library to embed [Apideck Vault](https://www.apideck.com/products/vault) in any web application.\n\n**Vault JS** | [React Vault](https://github.com/apideck-libraries/vault-react) | [Vue Vault](https://github.com/apideck-libraries/vue-vault)\n\n## Installation\n\n### Package\n\n```sh\nnpm install @apideck/vault-js\n```\n\n### Script\n\nIf you don't want to set up a build environment, you can get `@apideck/vault-js` from a CDN like unpkg.com and it will be globally available through the `window.ApideckVault` object.\n\n```html\n\u003cscript src=\"https://unpkg.com/@apideck/vault-js\"\u003e\u003c/script\u003e\n```\n\n## Prerequisites\n\nBefore opening the Vault modal with `@apideck/vault-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/vault-js`:\n\n```js\nimport { ApideckVault } from '@apideck/vault-js';\n\nApideckVault.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n});\n```\n\nIf you want to only show integrations for a single Unified API, you can do that by passing the `unifiedApi` option. If you want to open Vault for only a single integration, you can provide the `serviceId` option.\n\n```js\nimport { ApideckVault } from '@apideck/vault-js';\n\nApideckVault.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n  unifiedApi: 'accounting',\n  serviceId: 'quickbooks',\n});\n```\n\nIf you want to get notified when the modal opens and closes, you can provide the `onReady` and `onClose` options.\n\n```jsx\nimport { ApideckVault } from '@apideck/vault-js';\n\nApideckVault.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n  onClose: () =\u003e {\n    console.log('closed!');\n  },\n  onReady: () =\u003e {\n    console.log('ready!');\n  },\n});\n```\n\nIf you want to open a specific view you can pass the `initialView` prop. The available views are `settings`, `configurable-resources`, and `custom-mapping`.\n\n```js\nimport { ApideckVault } from '@apideck/vault-js';\n\nApideckVault.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n  unifiedApi: 'accounting',\n  serviceId: 'quickbooks',\n  initialView: 'custom-mapping',\n});\n```\n\nIf you want to open vault in a specific language you can pass a locale. The available locales are `en` (default), `nl`, `de`, `fr`, and `es`.\n\n```js\nimport { ApideckVault } from '@apideck/vault-js';\n\nApideckVault.open({\n  token: 'REPLACE_WITH_SESSION_TOKEN',\n  locale: 'nl',\n});\n```\n\nYou can also close the modal programmatically by calling `ApideckVault.close()`.\n\nIf you want to show a logo on top of the modal, you can set the `logo` property on the `theme` object you can provide through the session. [View Vault API documentation](https://developers.apideck.com/apis/vault/reference#operation/sessionsCreate).\n\n### Properties\n\n| Property           | Type                             | Required | Default | Description                                                                                                                                      |\n| ------------------ | -------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |\n| token              | string                           | true     | -       | The JSON Web Token returned from the [Create Session API](https://docs.apideck.com/apis/vault/reference#operation/sessionsCreate)                |\n| showAttribution    | boolean                          | false    | true    | Show \"Powered by Apideck\" in the backdrop of the modal backdrop                                                                                  |\n| open               | () =\u003e void                       | false    | -       | Function to open the Vault modal                                                                                                                 |\n| close              | () =\u003e void                       | false    | -       | Function to close the Vault modal                                                                                                                |\n| onReady            | () =\u003e void                       | false    | -       | Function that gets called when the modal is opened                                                                                               |\n| onClose            | () =\u003e void                       | false    | -       | Function that gets called when the modal is closed                                                                                               |\n| onConnectionChange | (connection: Connection) =\u003e void | false    | -       | Function that gets called when the user updates a connection. This can be linking their account, filling out settings or adding a new connection |\n| onConnectionDelete | (connection: Connection) =\u003e void | false    | -       | Function that gets called when the user deletes a connection                                                                                     |\n| unifiedApi         | string                           | false    | -       | When unifiedApi is provided it will only show integrations from that API.                                                                        |\n| serviceId          | string                           | false    | -       | When unifiedApi and serviceId are provided Vault opens a single integration                                                                      |\n| showConsumer       | boolean                          | false    | false   | If true it shows the current consumer metadata at the bottom of the modal                                                                        |\n| initialView        | ConnectionViewType               | false    | -       | Open Vault in a specific view for a connection: \"settings\", \"configurable-resources\", or \"custom-mapping\"                                        |\n| locale             | string                           | false    | \"en\"    | Open Vault in a specific language: \"en\", \"nl\", \"de\", \"fr\" or \"es\"                                                                                |\n| showLanguageSwitch | boolean                          | false    | false   | Show language switch at bottom                                                                                                                   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapideck-libraries%2Fvault-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapideck-libraries%2Fvault-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapideck-libraries%2Fvault-js/lists"}