1
0
Fork 0
mirror of synced 2024-06-14 00:14:39 +12:00

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 b9bee3aede
commit 5f3acec8e6
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
}