Add helper util for authenticating the public API SDK in component plugins
This commit is contained in:
parent
b9bee3aede
commit
5f3acec8e6
|
@ -17,6 +17,7 @@ import { getAction } from "utils/getAction"
|
||||||
import Provider from "components/context/Provider.svelte"
|
import Provider from "components/context/Provider.svelte"
|
||||||
import { ActionTypes } from "./constants"
|
import { ActionTypes } from "./constants"
|
||||||
import { fetchDatasourceSchema } from "./utils/schema.js"
|
import { fetchDatasourceSchema } from "./utils/schema.js"
|
||||||
|
import { getAPIKey } from "./utils/api.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
API,
|
API,
|
||||||
|
@ -36,4 +37,5 @@ export default {
|
||||||
fetchDatasourceSchema,
|
fetchDatasourceSchema,
|
||||||
Provider,
|
Provider,
|
||||||
ActionTypes,
|
ActionTypes,
|
||||||
|
getAPIKey,
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { API } from "api"
|
||||||
|
|
||||||
|
export const getAPIKey = async () => {
|
||||||
|
const { apiKey } = await API.fetchDeveloperInfo()
|
||||||
|
return apiKey
|
||||||
|
}
|
Loading…
Reference in New Issue