1.1.1 • Published 7 years ago

@creamery/gitlabclient v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

@creamery/gitlabclient

A simple gitlab client

But now, it should be used with middleware like koa-session.

Usage

const GitlabClient = require('@creamery/gitlabclient')

const gitlabClient = new GitlabClient({
  baseUrl,
  appId,
  appSecret,
  [oauthPath],
  [tokenPath],
  [redirectURI],
  [apiPath],
  [scope]
})

...

app.use(async (ctx, next) => {
  const token = ctx.session.accessToken
  try {
    const user = await gitlabClient.request({ path: '/user' }, token)
  } catch (err) {
    console.log(err)
  }
  ...
})