Skip to content

persiliao/axios-tauri-api-adapter

Repository files navigation

axios-tauri-api-adapter

Makes it easy to use Axios in Tauri App, Adapted for Tauri App 2.0.0

v1 version see https://github.com/persiliao/axios-tauri-api-adapter/tree/v1

Installation

npm install axios-tauri-api-adapter

Usage

TypeScript / JavaScript

import axios from 'axios';
import axiosTauriApiAdapter from 'axios-tauri-api-adapter';
const client = axios.create({ adapter: axiosTauriApiAdapter });

Tauri App

Configure the allowed URLs Tauri App HTTP client

{
  "permissions": [
    {
      "identifier": "http:default",
      "allow": [{ "url": "https://*.tauri.app" }],
      "deny": [{ "url": "https://private.tauri.app" }]
    }
  ]
}

Features

  • Add config.jwt It's going to add JWT to the header

Resources