A simple login type component which assists with the Authentication flow for the Investec Programmable Banking API.
You will need to have your Investec API keys at hand. Specifically, your client ID, client secret and API key. You can learn more about getting your Investec API keys in the Quick Start Quide.
npm install investec-auth-library
import { Auth } from 'investec-auth-library';
<Auth
url='page-to-redirect-to'
buttonColor='blue'
buttonText='Login'
buttonTextColor='white'
/>
Note: The form uses Tailwindcss for styling, so you will need to include Tailwindcss in your project.
The auth component form makes a POST request to the Investec Auth Endpoint which is done via a proxy. See the below example of using a proxy with Vite which can be added to your vite.config.js
or vite.config.ts
file.
server: {
proxy: {
'/api': {
target: 'https://openapi.investec.com/identity',
rewrite: path => path.replace('/api', ''),
changeOrigin: true,
secure: false,
ws: true,
}
}
}
Pull requests and changes are welcome.
This project is MIT licensed.