@k8slens/lens-platform-extension-sdk
v5.0.7
Published
Lens Platform SDK for Lens Extensions
Downloads
144
Readme
Lens Platform Extension Sdk
This is the branch for @k8slens/lens-platform-extension-sdk.
See branch release/lensapp
for @lensapp/lens-platform-extension-sdk.
Lens Platform Extension SDK
Use SDK in Lens extension:
import { LensClient } from "@k8slens/lens-platform-extension-sdk";
const lensClient = new LensClient({
getAccessToken: () => Promise.resolve("<token>"), // the callback to be called before every request, useful if the access token needs to be renew often.
});
The SDK uses axios internally for HTTP(s) requests.
Type Check
You should enable ts support in you editor with type-checking.
Or type-checking from CLI
npm run check:type
Test
The "all-in-one" test script would run linter, type-checking, and unit tests in parallel.
npm run test
You can also run unit tests only
npm run test:unit [-- --watch]
which is just a shortcut for npx jest [--watch]
Documentation
We use tsdoc
https://github.com/microsoft/tsdoc for inline doc comments.
License
Copyright (c) 2022 Mirantis, Inc.
Licensed under the MIT license. https://opensource.org/licenses/MIT