📗API Setup - Text

Required for Mindplug API access

Base Instance

In this setup, we will use axios which is an industry standard package for making API calls.

It is recommended to create a base instance of axios which utilizes your mindplug key in one file. This makes it easier to manage for the future. The file can be stored anywhere within the src directory.

src/mindplugAPI.ts
// Axios instance with mindplug auth
import axios from 'axios';

const mindplug = axios.create({
    baseURL: "https://connect.mindplug.io/api",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer <MINDPLUG_KEY>"
    }
});

 export default mindplug; 

Last updated