mslapi-js-sdk
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.6 • Public • Published

    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.

    Install

    npm i mslapi-js-sdk

    DownloadsWeekly Downloads

    141

    Version

    1.0.6

    License

    BSD-3-Clause

    Unpacked Size

    31.3 kB

    Total Files

    20

    Last publish

    Collaborators

    • 0xnu