husqvarna-authentication-sdk
v1.1.0
Published
Husqvarna Authentication API SDK
Maintainers
Readme
husqvarna-authentication-sdk (Unofficial)
This package provides a TypeScript/JavaScript SDK for the Husqvarna Authentication API.
⚠️ Disclaimer ⚠️ This SDK is not an official Husqvarna product. It is an open-source community project, built on top of the public API documented by Husqvarna. It's generated from the OpenAPI specification provided by Husqvarna with OpenAPI Generator.
Users of this SDK must :
- Create their own API key and OAuth2 credentials on the Husqvarna Developer Portal.
- Follow the official API Terms of Use.
This package is use
Installation
To install the package, run one of the following commands in your project folder :
NPM :
npm install husqvarna-authentication-sdkPNPM :
pnpm add husqvarna-authentication-sdkYarn :
yarn add husqvarna-authentication-sdkUsage
Import the package in your TypeScript or JavaScript code :
import { OAuth2Api, Oauth2TokenPostGrantTypeEnum } from 'husqvarna-authentication-sdk';
const apiAuth = new OAuth2Api();
const tokenReponse = await apiAuth.oauth2TokenPost({
clientId: <Application ID>,
clientSecret: <Application Secret>,
grantType: Oauth2TokenPostGrantTypeEnum.CLIENT_CREDENTIALS
});
console.info(`Access Token : ${tokenReponse.data.accessToken}`);Documentation
The full API documentation is available on the Husqvarna Developer Portal.
Documentation for API Endpoints
All URIs are relative to https://api.authentication.husqvarnagroup.dev/v1
| Class | Method | HTTP request | Description | | ----------- | ---------------------------------------------------------- | ----------------------- | ------------- | | OAuth2Api | oauth2RevokePost | POST /oauth2/revoke | OAuth2 logout | | OAuth2Api | oauth2TokenPost | POST /oauth2/token | OAuth2 login |
Documentation For Models
Documentation For Authorization
Authentication schemes defined for the API:
APIKeyHeader
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
AuthorizationHeader
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
