@basiq/connect-auth 1.0.13 → 1.1.1
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/README.md +45 -39
- package/package.json +1 -3
- package/dist/index.d.mts +0 -8
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -1178
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1142
- package/dist/index.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,60 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Basiq Connect Component
|
|
2
2
|
|
|
3
3
|
The Basiq Connect Auth is a ReactJS UI component exposed to partners who prefer to implement the auth flow as an external component with an SMS OTP built in. When rendered, it will take the user through an SMS OTP flow and then proceed to redirect them to the [Basiq Consent UI](https://api.basiq.io/docs/consent-ui) flow to connect their accounts.
|
|
4
4
|
|
|
5
|
-
Note
|
|
5
|
+
**Note**: This has been offered as an interim solution for partners who require access to v3 of the API before we have released the upgrades to `https://connect.basiq.io/`. If you have any questions regarding this, please reach out to support@basiq.io.
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
9
9
|
1. Install `@basiq/connect-auth` and import the component
|
|
10
10
|
|
|
11
|
-
```
|
|
12
|
-
$ npm install @basiq/
|
|
13
|
-
```
|
|
11
|
+
```bash
|
|
12
|
+
$ npm install @basiq/connect-auth
|
|
13
|
+
```
|
|
14
14
|
|
|
15
|
-
```js
|
|
16
|
-
import { BasiqConnect } from "@basiq/connect-auth";
|
|
17
|
-
```
|
|
15
|
+
```js
|
|
16
|
+
import { BasiqConnect } from "@basiq/connect-auth";
|
|
17
|
+
```
|
|
18
18
|
|
|
19
19
|
2. Generate a new Auth Link, and retrieve the auth link ID from the public URL that is returned.
|
|
20
20
|
|
|
21
|
-
```js
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
);
|
|
21
|
+
```js
|
|
22
|
+
try {
|
|
23
|
+
const { data } = await axios.get(
|
|
24
|
+
`https://au-api.basiq.io/users/{userId}/auth_link`,
|
|
25
|
+
{
|
|
26
|
+
method: 'post',
|
|
27
|
+
headers: {
|
|
28
|
+
Authorization: `Bearer ${YOUR_SERVER_ACCESS_TOKEN}`,
|
|
29
|
+
Accept: 'application/json',
|
|
30
|
+
'Content-Type': 'application/json',
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
);
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
let auth_id = data.links.public.replace('https://connect.basiq.io/','');
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
return auth_id;
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.log(error)
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
3. Drop the component in your code on the page you wish to call it. The component will retrieve the `auth_id` from the URL, so failing to include it there will result in an error. **Note** that the component is full page and will eventually handle the redirect to the Basiq Consent UI, so it should be rendered on its own page (or conditionally, after appending an `auth_link` ID).
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
```jsx
|
|
47
|
+
// Component rendered at /auth-link/:auth_id
|
|
47
48
|
|
|
49
|
+
export default function Auth() {
|
|
50
|
+
return (
|
|
51
|
+
<main>
|
|
52
|
+
<BasiqConnect />
|
|
53
|
+
</main>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
```
|
|
48
57
|
|
|
49
|
-
|
|
58
|
+
## Updates
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
**OTP Code Length Increased**: The OTP code length has been increased from 4 to 6 characters to enhance security.
|
|
52
61
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
```
|
|
62
|
+
## Demo
|
|
63
|
+
|
|
64
|
+
You can see a demo of the Basiq Connect Auth component in action below:
|
|
65
|
+
|
|
66
|
+
<div style="position: relative; padding-bottom: calc(50.161117078410314% + 41px); height: 0; width: 100%;"><iframe src="https://demo.arcade.software/DhU1AMDeKC4f6PxNmJcP?embed" title="Basiq | OTP Demo" frameborder="0" loading="lazy" webkitallowfullscreen mozallowfullscreen allowfullscreen allow="clipboard-write" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;color-scheme: light;"></iframe></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basiq/connect-auth",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"build": "tsup",
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
14
|
},
|
|
15
|
-
|
|
16
15
|
"license": "ISC",
|
|
17
16
|
"typings": "dist/index.d.ts",
|
|
18
17
|
"engines": {
|
|
@@ -27,7 +26,6 @@
|
|
|
27
26
|
"singleQuote": true,
|
|
28
27
|
"trailingComma": "es5"
|
|
29
28
|
},
|
|
30
|
-
|
|
31
29
|
"author": "Basiq",
|
|
32
30
|
"size-limit": [
|
|
33
31
|
{
|
package/dist/index.d.mts
DELETED