Quick Start

If you get stuck at any point, email for help at zack@trykeet.com. If you don’t get a response in 10 minutes, we’ll buy you coffee.

Keet link uses a series of token exchanges to authenticate your users accounts.

    Step 1: Get a linkToken so that you can initialize a link session for your users

    Step 2: Make Keet Link appear in your frontend using the linkToken

    Step 3: Swap the publicToken, returned by keetLink for an accountToken

    Step 4: Use the accountToken for future requests to authenticated sessions.

In your backend, set up a POST request to initialize a Keet Link session and get a linkToken from this URL: https://api.trykeet.com/v1/link/token

POST
1curl -X POST https://api.trykeet.com/v1/link/token \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "linkConfig": {
6 "endUserId": "<userId>",
7 "integration": "Instagram",
8 "companyLogoUri": "https://example.com/logo.png"
9 }
10}'
Response
1{
2 "status": "ok",
3 "linkToken": "<token>"
4}

You can now pass this public linkToken back to your client to initialize the link component.

  1. Install the link sdk: npm install @keet-tech/react-keet-link

  2. Use the linkToken from Step 1 to open Keet link

1 import { useKeetLink } from "@keet-tech/react-keet-link"
2 import { useEffect, useState } from "react"
3
4 export default function App() {
5 const { open, isReady } = useKeetLink({
6 linkToken: "ADD YOUR LINK TOKEN -- SEE STEP 1",
7 onSuccess
8 onValidationError
9 })
10
11 const onSuccess = (publicToken: string) => {
12 /* send a request to your backend
13 to exchange this for an account token */
14 }
15
16 const onValidationError = (errors: any) => {
17 console.error("An error from Keet Link occured: ", errors)
18 }
19
20 return (
21 <button disabled={!isReady} onClick={open}>Open Link</button>
22 )
23 }
24
25 export default App;

Step 3: Swap publicToken for accountToken (Server Side)

In your backend, create a request to exchange the short-lived publicToken for a permanent accountToken.

POST
1curl -X POST https://api.trykeet.com/v1/linked-accounts/token \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "publicToken": "..."
6}'
Response
1{
2 "status": "ok",
3 "accountToken": "acc_..."
4}

Store this account token someplace secure. It is used to make all requests to this end users authenticated sessions.

You’re done!

Use the accountToken to make all future requests on behalf of the user to every integration they use.

Check out how to use your integrations