1.0.6 • Published 2 years ago
mslapi-js-sdk v1.0.6
MLS API SDK for JavaScript
Develop and deploy applications, mobile and web, with popular JavaScript Frameworks using MLS API SDK for JavaScript.
Install
yarn add mslapi-js-sdk
# or
npm i mslapi-js-sdk
Example of Usage
import api from 'mslapi-js-sdk'
import axios from 'axios'
// MODULE USED
// - assists
const { assists, setAxiosInstance } = api
// setAxiosInstance(axios.create({
// baseURL: 'https://mlssoccerapi.com',
// timeout: 0
// }))
await api.authentication.login({ username: <username>, password: <password> })
assists.getAll().then(res => {
console.log(res)
})
assists.getByID('xxx').then(res => {
console.log(res)
})
assists.add({
league_name: 'string',
standing: 'string',
player_name: 'string',
team_name: 'string',
assists: 'string',
tag: 'string'
}).then(res => {
console.log(res)
})
assists.updateByID({
id: 'string',
league_name: 'string',
standing: 'string',
player_name: 'string',
team_name: 'string',
assists: 'string',
tag: 'string'
}).then(res => {
console.log(res)
})
assists.deleteByID('xxx').then(res => {
console.log(res)
})
Available Modules
- assists
- authentication
- fixtures
- historicalData
- lasterNews
- offence
- players
- realTimeData
- standings
- teams
- topScorer
Methods
//you can save the token and use it next time
// **setToken(tokenValue)**
//get the token string
// **getToken()**
import {setToken, getToken} from 'mslapi-js-sdk';
The MLS API documentation is available here. If you need further assistance, don't hesitate to contact us.
License
This project is licensed under the BSD 3-Clause License.
Copyright
(c) 2022 Moat Systems Limited.