flattrade-auth
v1.0.1
Published
Authentication library for Flattrade API integration
Maintainers
Readme
Flattrade Auth Library
A TypeScript library for authenticating with Flattrade's API using OAuth 2.0 flow.
Installation
npm install flattrade-authUsage
import { FlattradeAuth } from 'flattrade-auth';
const { account_id, token } = await FlattradeAuth.getAPIAuthToken({
account_id: 'your_account_id',
password: 'your_password',
api_key: 'your_api_key',
totpSecret: 'your_totp_secret',
authSecret: 'your_auth_secret'
});API
FlattradeAuth.getAPIAuthToken(params)
Returns a Promise that resolves to an object containing the authentication token and account ID.
Parameters:
params(object): Configuration object with the following properties:account_id(string): Your Flattrade account IDpassword(string): Your account passwordapi_key(string): Your API keytotpSecret(string): Your TOTP secret for 2FAauthSecret(string): Your authentication secret
Returns: Promise<FlattradeAuthResponse> - Object containing:
account_id(string): The authenticated account IDtoken(string): The authentication token
Development
# Install dependencies
npm install
# Build the library
npm run build
# Run tests
npm testLicense
GNU Affero General Public License v3.0 (AGPL-3.0)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
