tink-ab / tink-link-web-example

An example web app demonstrating integration with the Tink API

Home Page:https://docs.tink.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Platform Languages

Tink Example

This is an example web app that demonstrates how you can integrate the Tink API to fetch accounts and transaction data.

Installation

Install the LTS (v18+) or newer version of Nodejs.

Prerequisites

  1. Create your developer account at Tink Console
  2. Follow the getting started guide to retrieve your client_id and client_secret
  3. Register the redirect URI for the example app (http://localhost:3000/callback) in the list of redirect URIs under your app's settings

Running locally

  1. Set environment variables

Update the "start" script in package.json to include your client id and client secret

diff --git a/package.json b/package.json
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "description": "",
   "main": "server.js",
   "scripts": {
-    "start": "TINK_CLIENT_SECRET= TINK_CLIENT_ID= node server.mjs"
+    "start": "TINK_CLIENT_SECRET=c37cc3c09ab947f5a6fcab********** TINK_CLIENT_ID=de18d62c4d1643c0b3fcea********** node server.mjs"
   },
   "author": "",
   "license": "ISC",
  1. Set client_id in index.html

Replace <TINK_CLIENT_ID> with your client id in the value of the input name="client_id"

--- a/index.html
+++ b/index.html
@@ -40,7 +40,7 @@
           </select>
         </div>
 
-        <input type="hidden" name="client_id" value="<TINK_CLIENT_ID>" />
+        <input type="hidden" name="client_id" value="de18d62c4d1643c0b3fcea**********" />
         <input type="hidden" name="redirect_uri" value="http://localhost:3000/callback" />
 
         <button class="btn">Go!</button>
  1. Run the local server
npm start

Open http://localhost:3000 in your browser.


Resources

About

An example web app demonstrating integration with the Tink API

https://docs.tink.com

License:MIT License


Languages

Language:JavaScript 52.9%Language:CSS 25.0%Language:HTML 22.2%