Add helper util for authenticating the public API SDK in component plugins

This commit is contained in:
Andrew Kingston 2022-09-21 09:49:33 +01:00
parent 398a65c821
commit e2982e1454
2 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import { getAction } from "utils/getAction"
import Provider from "components/context/Provider.svelte"
import { ActionTypes } from "./constants"
import { fetchDatasourceSchema } from "./utils/schema.js"
import { getAPIKey } from "./utils/api.js"
export default {
API,
@ -36,4 +37,5 @@ export default {
fetchDatasourceSchema,
Provider,
ActionTypes,
getAPIKey,
}

View File

@ -0,0 +1,6 @@
import { API } from "api"
export const getAPIKey = async () => {
const { apiKey } = await API.fetchDeveloperInfo()
return apiKey
}