@quiltt/vue 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ # MIT License
2
+
3
+ Copyright (c) Quiltt, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,212 @@
1
+ # @quiltt/vue
2
+
3
+ [![npm version](https://badge.fury.io/js/@quiltt%2Fvue.svg)](https://badge.fury.io/js/@quiltt%2Fvue)
4
+ [![CI](https://github.com/quiltt/quiltt-js/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/quiltt/quiltt-js/actions/workflows/ci.yml)
5
+
6
+ Vue 3 composables and components for Quiltt Connector.
7
+
8
+ For general project information and contributing guidelines, see the [main repository README](../../README.md).
9
+
10
+ ## Installation
11
+
12
+ ```shell
13
+ npm install @quiltt/vue vue
14
+ ```
15
+
16
+ ## Core Modules and Types
17
+
18
+ `@quiltt/vue` re-exports all functionality from `@quiltt/core`, so you only need to install this one package to access core API clients, authentication utilities, storage, and TypeScript types along with Vue components and composables. See the [Core README](../core/README.md) for more information.
19
+
20
+ ## Quick Start
21
+
22
+ ```typescript
23
+ // main.ts
24
+ import { createApp } from 'vue'
25
+ import { QuilttPlugin } from '@quiltt/vue'
26
+
27
+ createApp(App).use(QuilttPlugin).mount('#app')
28
+ ```
29
+
30
+ ```vue
31
+ <script setup lang="ts">
32
+ import { QuilttButton, useQuilttSession } from '@quiltt/vue'
33
+
34
+ const { importSession } = useQuilttSession()
35
+
36
+ // Set session token when available (e.g., after login)
37
+ const onLogin = async (token: string) => {
38
+ await importSession(token)
39
+ }
40
+ </script>
41
+
42
+ <template>
43
+ <QuilttButton
44
+ connector-id="YOUR_CONNECTOR_ID"
45
+ @exit-success="(m) => console.log('Connected:', m.connectionId)"
46
+ >
47
+ Add Bank Account
48
+ </QuilttButton>
49
+ </template>
50
+ ```
51
+
52
+ ## Components
53
+
54
+ For better tree-shaking, you can import components from subpaths:
55
+
56
+ ```ts
57
+ import { QuilttButton } from '@quiltt/vue/components'
58
+ ```
59
+
60
+ ### QuilttButton
61
+
62
+ Opens the connector in a modal overlay.
63
+
64
+ ```vue
65
+ <QuilttButton connector-id="YOUR_CONNECTOR_ID" @exit-success="handleSuccess">
66
+ Connect Account
67
+ </QuilttButton>
68
+ ```
69
+
70
+ ### QuilttContainer
71
+
72
+ Renders the connector inline.
73
+
74
+ ```vue
75
+ <QuilttContainer connector-id="YOUR_CONNECTOR_ID" @exit-success="handleSuccess" />
76
+ ```
77
+
78
+ ### QuilttConnector
79
+
80
+ Full-page iframe for embedded integration.
81
+
82
+ ```vue
83
+ <QuilttConnector
84
+ connector-id="YOUR_CONNECTOR_ID"
85
+ @exit-success="handleSuccess"
86
+ @navigate="handleNavigate"
87
+ style="width: 100%; height: 100vh" />
88
+ ```
89
+
90
+ ## Composables
91
+
92
+ For better tree-shaking, you can import composables from subpaths:
93
+
94
+ ```ts
95
+ import { useQuilttSession } from '@quiltt/vue/composables'
96
+ ```
97
+
98
+ ### useQuilttSession
99
+
100
+ ```typescript
101
+ import { useQuilttSession } from '@quiltt/vue'
102
+
103
+ const {
104
+ session, // Reactive session state
105
+ importSession, // Import an existing token
106
+ identifySession, // Start auth flow (email/phone)
107
+ authenticateSession, // Complete auth (passcode)
108
+ revokeSession, // Invalidate session server-side
109
+ forgetSession, // Clear session locally
110
+ } = useQuilttSession()
111
+
112
+ await importSession('YOUR_SESSION_TOKEN')
113
+ console.log(session.value?.token)
114
+ ```
115
+
116
+ ### useQuilttConnector
117
+
118
+ ```typescript
119
+ import { useQuilttConnector } from '@quiltt/vue'
120
+
121
+ const { open } = useQuilttConnector('YOUR_CONNECTOR_ID', {
122
+ onExitSuccess: (m) => console.log('Connected:', m.connectionId),
123
+ })
124
+ ```
125
+
126
+ ```vue
127
+ <button @click="open">Add Account</button>
128
+ ```
129
+
130
+ ### Additional Composables
131
+
132
+ `@quiltt/vue` also exports:
133
+
134
+ - `useQuilttInstitutions` — Search available institutions for a connector.
135
+ - `useQuilttResolvable` — Check if a provider connection can be resolved.
136
+ - `useQuilttSettings` — Access plugin-provided settings such as `clientId`.
137
+ - `useSession` — Low-level reactive session state manager.
138
+ - `useStorage` — Reactive wrapper around Quiltt global storage.
139
+
140
+ Composable context behavior:
141
+
142
+ - `useQuilttSession`, `useQuilttInstitutions`, and `useQuilttResolvable` require `QuilttPlugin` provider context and throw if used without it.
143
+ - `useQuilttConnector` continues without plugin session context and logs a warning.
144
+ - `useQuilttSettings` returns `undefined` values when plugin context is unavailable.
145
+
146
+ ### Plugin Exports
147
+
148
+ You can import plugin utilities from the dedicated subpath:
149
+
150
+ ```ts
151
+ import { QuilttPlugin, QuilttSessionKey, QuilttSetSessionKey } from '@quiltt/vue/plugin'
152
+ ```
153
+
154
+ ## Props and Events
155
+
156
+ | Prop | Type | Description |
157
+ | ------ | ------ | ------------- |
158
+ | `connector-id` | `string` | **Required.** Quiltt Connector ID |
159
+ | `connection-id` | `string` | Existing connection ID for reconnection |
160
+ | `institution` | `string` | Pre-select an institution |
161
+ | `app-launcher-url` | `string` | Deep link URL for OAuth callbacks |
162
+
163
+ | Event | Payload | Description |
164
+ | ------- | --------- | ------------- |
165
+ | `@load` | `metadata` | Connector loaded |
166
+ | `@exit-success` | `metadata` | Connection successful |
167
+ | `@exit-abort` | `metadata` | User cancelled |
168
+ | `@exit-error` | `metadata` | Error occurred |
169
+
170
+ ## Reconnection
171
+
172
+ Pass `connection-id` to reconnect an existing connection:
173
+
174
+ ```vue
175
+ <QuilttButton connection-id="YOUR_EXISTING_CONNECTION_ID" ... />
176
+ ```
177
+
178
+ ## Capacitor / Ionic
179
+
180
+ For mobile apps, use `@quiltt/capacitor/vue` which adds native OAuth handling:
181
+
182
+ ```typescript
183
+ import { QuilttConnector, QuilttConnectorPlugin } from '@quiltt/capacitor/vue'
184
+
185
+ // Handle OAuth deep links
186
+ QuilttConnectorPlugin.addListener('deepLink', ({ url }) => {
187
+ connectorRef.value?.handleOAuthCallback(url)
188
+ })
189
+ ```
190
+
191
+ See [@quiltt/capacitor](../capacitor#readme) for full documentation.
192
+
193
+ ## Resources
194
+
195
+ - [Vue SDK Guide](https://www.quiltt.dev/connector/sdk/vue)
196
+ - [Issuing Session Tokens](https://www.quiltt.dev/authentication/issuing-session-tokens)
197
+ - [Connector Configuration](https://www.quiltt.dev/connector)
198
+
199
+ ## License
200
+
201
+ MIT
202
+
203
+ ## Contributing
204
+
205
+ For information on how to contribute to this project, please refer to the [repository contributing guidelines](../../CONTRIBUTING.md).
206
+
207
+ ## Related Packages
208
+
209
+ - [`@quiltt/core`](../core#readme) - Essential functionality and types
210
+ - [`@quiltt/react`](../react#readme) - React components and hooks
211
+ - [`@quiltt/react-native`](../react-native#readme) - React Native and Expo components
212
+ - [`@quiltt/capacitor`](../capacitor#readme) - Capacitor plugin and mobile framework adapters