1.2.5 • Published 3 months ago

@gcgov/apiservice v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Api Service

Installation

npm install @gcgov/apiservice

Example Usage

//MyApiService.js
import {ApiService,ApiConfig} from "@gcgov/apiservice"

const config = new ApiConfig(
	'https://www.myapi.com/',      //base url for the api
	'XDEBUG_SESSION=PHPSTORM',     //url parameters to be added to every request
	true,                          //api requires authentication
	async () => {                  //method to get and auto refresh the api access token
		return await yourGetAccessTokenFn();
	}
)

class MyApiService extends ApiService {

	//add custom methods here, if required
    
}

export default new MyApiService( config )
1.2.5

3 months ago

1.2.0

3 months ago

1.2.4

3 months ago

1.2.3

3 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.4

8 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago