File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ npm install wakatime-client --save
2323## API
2424
2525* [ Create Instance Using API Key] ( #create-instance-using-api-key )
26+ * [ Custom Base URLs] ( #custom-base-urls )
2627* [ ` getUser ` ] ( #getuser )
2728* [ ` getMe ` ] ( #getme )
2829* [ ` getTeams ` ] ( #getteams )
@@ -68,6 +69,13 @@ import { WakaTimeClient } from 'wakatime-client';
6869const client = new WakaTimeClient (' some api key' );
6970```
7071
72+ #### Custom Base URLs
73+ ``` javascript
74+ import { WakaTimeClient } from ' wakatime-client' ;
75+
76+ const client = new WakaTimeClient (' some api key' , ' https://wakapi.dev/api/v1' );
77+ ```
78+
7179### ` getUser `
7280
7381Get details for user
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ const rangeQueryParameters = Object.freeze({
1515} ) ;
1616
1717class WakaTimeClient {
18- constructor ( apiKey ) {
18+ constructor ( apiKey , baseURL = 'https://wakatime.com/api/v1/' ) {
1919 this . apiKey = apiKey ;
2020 this . axiosConfiguration = axios . create ( {
21- baseURL : 'https://wakatime.com/api/v1/' ,
21+ baseURL,
2222 // Base-64 encode the API Key
2323 // https://wakatime.com/developers#introduction
2424 headers : { Authorization : `Basic ${ Buffer . from ( this . apiKey ) . toString ( 'base64' ) } ` } ,
You can’t perform that action at this time.
0 commit comments