@basiq/connect-auth 0.1.91 → 1.0.0

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 CHANGED
@@ -1,7 +1,60 @@
1
- # BASIQ CONNECT AUTH
1
+ # BASIQ CONNECT COMPONENT
2
2
 
3
- This is a code for npm package that is used in basiq-connect project. It is a new version and it has just sms code verification part.
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
- ## Implementation
5
+ Note: This has been offered as 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
- import `<BasiqConnect />` to the desired place in the project. If you want to test it, use `test` property and set it to `true`
7
+ ## Setup
8
+
9
+ 1. Install `@basiq/connect-auth` and import the component
10
+
11
+ ```
12
+ $ npm install @basiq/basiq-connect-control
13
+ ```
14
+
15
+ ```js
16
+ import { BasiqConnect } from "@basiq/connect-auth";
17
+ ```
18
+
19
+ 2. Generate a new Auth Link, and retrieve the auth link ID from the public URL that is returned.
20
+
21
+ ```js
22
+
23
+ try {
24
+ const { data } = await axios.get(
25
+ `https://au-api.basiq.io/users/{userId}/auth_link`,
26
+ {
27
+ method: 'post',
28
+ headers: {
29
+ Authorization: `Bearer ${YOUR_SERVER_ACCESS_TOKEN}`,
30
+ Accept: 'application/json',
31
+ 'Content-Type': 'application/json',
32
+ },
33
+ }
34
+ );
35
+
36
+ let auth_id = data.links.public.replace('https://connect.basiq.io/','');
37
+
38
+ return auth_id;
39
+
40
+ } catch (error) {
41
+ console.log(error)
42
+ }
43
+
44
+ ```
45
+
46
+ 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 it's own page (or conditionally, after appending an auth_link ID)
47
+
48
+
49
+ ```jsx
50
+
51
+ // Component rendered at /auth-link/:auth_id
52
+
53
+ export default function Auth() {
54
+ return (
55
+ <main>
56
+ <BasiqConnect />
57
+ </main>
58
+ );
59
+ }
60
+ ```
@@ -609,7 +609,7 @@ var PageShadowWrapper = /*#__PURE__*/styled__default.div(_templateObject5$2 || (
609
609
  return horizontal && styled.css(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteralLoose(["\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\n\t\t\t", " {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t\tmargin-right: 16px;\n\n\t\t\t\t&:last-child {\n\t\t\t\t\tmargin-right: unset;\n\t\t\t\t}\n\t\t\t}\n\t\t"])), ButtonStyled);
610
610
  });
611
611
  var PageShadow = /*#__PURE__*/styled__default.div(_templateObject7$1 || (_templateObject7$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n\tposition: absolute;\n\theight: 71px;\n\tleft: 0;\n\tright: 0;\n\ttop: -71px;\n\tbackground: linear-gradient(180deg, #cecece 0%, ", " 100%);\n\topacity: 0.8;\n\ttransform: rotate(-180deg);\n\tpointer-events: none;\n"])), /*#__PURE__*/hexToRGBa('#cecece', 0));
612
- var PageHeader = /*#__PURE__*/styled__default.header(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n\tmargin-bottom: 32px;\n\twidth: 100%;\n\tborder-radius: 8px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground-color: ", ";\n\tpadding: 16px;\n\tbox-sizing: border-box;\n\theight: 150px;\n\t", " {\n\t\tbackground-color: unset;\n\t\toverflow: initial;\n\t\theight: 150px;\n\t\tpadding: 16px;\n\t}\n\timg {\n\t\tborder-radius: 4px;\n\t\twidth: auto !important;\n\t\theight: auto;\n\t\tmax-width: 100%;\n\t\tmax-height: 100%;\n\t\t", " {\n\t\t\twidth: 100%;\n\t\t\tpadding: 16px;\n\t\t}\n\t}\n"])), function (_ref7) {
612
+ var PageHeader = /*#__PURE__*/styled__default.header(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n\tmargin-bottom: 32px;\n\twidth: 100%;\n\tborder-radius: 8px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground-color: ", ";\n\tpadding: 16px;\n\tbox-sizing: border-box;\n\theight: 150px;\n\t", " {\n\t\tbackground-color: unset;\n\t\toverflow: initial;\n\t\theight: 150px;\n\t\tpadding: 16px 0\n\t\tmargin-bottom: 0;\n\t}\n\timg {\n\t\tborder-radius: 4px;\n\t\twidth: auto !important;\n\t\theight: auto;\n\t\tmax-width: 100%;\n\t\tmax-height: 100%;\n\t\t", " {\n\t\t\twidth: 100%;\n\t\t\tpadding: 16px;\n\t\t}\n\t}\n"])), function (_ref7) {
613
613
  var theme = _ref7.theme;
614
614
  return theme.color.porcelainSecond;
615
615
  }, devices.phone, devices.phone);