New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@apideck/vault-js

Package Overview
Dependencies
Maintainers
7
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apideck/vault-js - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

1

dist/index.d.ts

@@ -5,2 +5,3 @@ export interface ApideckVaultOptions {

serviceId?: string;
showAttribution?: boolean;
onClose?: () => void;

@@ -7,0 +8,0 @@ onReady?: () => void;

6

package.json
{
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",

@@ -22,3 +22,4 @@ "main": "dist/index.js",

"analyze": "size-limit --why",
"dev": "parcel dev/index.html"
"dev": "parcel dev/index.html",
"release": "np --no-publish && npm publish --access public --registry https://registry.npmjs.org"
},

@@ -56,2 +57,3 @@ "peerDependencies": {},

"husky": "^8.0.2",
"np": "^7.6.2",
"parcel": "^2.8.2",

@@ -58,0 +60,0 @@ "size-limit": "^8.1.0",

@@ -22,3 +22,3 @@ # Vault JS

```
```html
<script src="https://unpkg.com/@apideck/vault-js"></script>

@@ -29,7 +29,7 @@ ```

Before opening the Vault modal with vault-js, you need to create a Vault session from your backend using the Vault API or one of our SDKs. Find out more [here]().
Before opening the Vault modal with 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).
## Usage
Pass the JWT you got from the Vault session to the vault-js:
Pass the JWT you got from the Vault session to `vault-js`:

@@ -40,23 +40,16 @@ ```js

ApideckVault.open({
token: jwtSessionToken
})
token: 'REPLACE_WITH_SESSION_TOKEN',
});
```
If you want to scope the connection results to a single Unified API, you can do that by giving the `unifiedApi` prop. If you want to open Vault for only a single connector, you should also provide the `serviceId`.
If 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.
```js
import { Vault } from '@apideck/react-vault';
import { ApideckVault } from '@apideck/vault-js';
const MyComponent = () => {
return (
<Vault
token="REPLACE_WITH_SESSION_TOKEN"
unifiedApi="accounting"
serviceId="quickbooks"
trigger={<button>Open Vault</button>}
/>
);
};
export default MyComponent;
ApideckVault.open({
token: 'REPLACE_WITH_SESSION_TOKEN',
unifiedApi: 'accounting',
serviceId: 'quickbooks',
});
```

@@ -67,22 +60,13 @@

```jsx
import { Button } from '@apideck/components';
import { Vault } from '@apideck/react-vault';
import { useState } from 'react';
import { ApideckVault } from '@apideck/vault-js';
const VaultButton = ({ token }) => {
const [openVault, setOpenVault] = useState(false);
const toggleVault = () => {
setOpenVault(!openVault);
};
return (
<div className="flex items-center space-x-3">
<Button text="Open Vault" onClick={toggleVault} />
<Vault token={token} open={openVault} onClose={toggleVault} />
</div>
);
};
export default VaultButton;
ApideckVault.open({
token: 'REPLACE_WITH_SESSION_TOKEN',
onClose: () => {
console.log('closed!');
},
onReady: () => {
console.log('ready!');
},
});
```

@@ -92,9 +76,9 @@

| Property | Type | Required | Default | Description |
| --------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| token | string | true | - | The JSON Web Token returned from the Create Session call |
| trigger | element | false | - | The component that should trigger the Vault modal on click |
| showAttribution | boolean | false | true | Show "Powered by Apideck" in the backdrop of the modal backdrop | |
| onClose | event | false | - | Function that gets called when the modal is closed |
| unifiedApi | string | false | - | When unifiedApi is provided it will scope the connection results to that API. If also a serviceId is provided Vault opens for a single connection |
| serviceId | string | false | - | When unifiedApi and serviceId are provided Vault opens a single connection |
| Property | Type | Required | Default | Description |
| --------------- | ------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| token | string | true | - | The JSON Web Token returned from the [Create Session API](https://docs.apideck.com/apis/vault/reference#operation/sessionsCreate) |
| showAttribution | boolean | false | true | Show "Powered by Apideck" in the backdrop of the modal backdrop |
| onClose | event | false | - | Function that gets called when the modal is closed |
| onReady | event | false | - | Function that gets called when the modal is opened |
| unifiedApi | string | false | - | When unifiedApi is provided it will only show integrations from that API. |
| serviceId | string | false | - | When unifiedApi and serviceId are provided Vault opens a single integration |

@@ -5,2 +5,3 @@ export interface ApideckVaultOptions {

serviceId?: string;
showAttribution?: boolean;
onClose?: () => void;

@@ -7,0 +8,0 @@ onReady?: () => void;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc