The WakaTime API enables developers to easily track, analyze, and display real-time coding activity and metrics. With the WakaTime API, you can build apps that help you measure and improve programming productivity. Here are a few examples of the type of applications and features you can create with the WakaTime API:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
wakatime: {
type: "app",
app: "wakatime",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://wakatime.com/api/v1/users/current`,
headers: {
Authorization: `Bearer ${this.wakatime.$auth.oauth_access_token}`,
},
})
},
})
WakaTime uses OAuth authentication. When you connect your WakaTime account, Pipedream will open a popup window where you can sign into WakaTime and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any WakaTime API.
Pipedream requests the following authorization scopes when you connect your account:
email
read_logged_time
write_logged_time
read_stats
read_orgs
read_private_leaderboards
GET
https://wakatime.com/oauth/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.comma_separated_scopes}}
POST
https://wakatime.com/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://wakatime.com/oauth/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}
&
redirect_uri={{oauth.redirect_uri}}