@creamery/gitlabclient

1.1.1 • Public • Published

@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)
  }
  ...
})

Readme

Keywords

Package Sidebar

Install

npm i @creamery/gitlabclient

Weekly Downloads

1

Version

1.1.1

License

MIT

Last publish

Collaborators

  • creamidea