πŸ“—API Setup - PDFs

Setup PDF upload to Mindplug

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.

This instance is the same as the Text instance with only difference being in the headers.

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": "multipart/form-data",
        "Authorization": "Bearer <MINDPLUG_KEY>"
    }
});

 export default mindplug; 

Last updated