Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.87 KB

README.md

File metadata and controls

61 lines (42 loc) · 1.87 KB

🌟 Community-Powered Repository 🌟

This repository is crafted with ❤️ by our talented community members. It's a space for everyone to use, contribute to, and share. While it aligns with the spirit of our community, please note that this repo is not directly endorsed or supported by Investec. Always exercise caution and discretion when using or contributing to community-driven projects.

Investec Auth Library

A simple login type component which assists with the Authentication flow for the Investec Programmable Banking API.

Example

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.

🔑 Getting Started

Installing

npm install investec-auth-library

Example

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.

Proxy Server

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,
    }
  }
}

🧑‍💻 Contributions

Pull requests and changes are welcome.

📄 License

This project is MIT licensed.