github 3.0.2

  • Installing
  • Versions
  • 70

GitHub for Dart

This is a Client Library for GitHub in Dart. I wrote this out of necessity, and then when I got a great reaction from the Dart community, I decided to put a lot of effort into it.

Please submit issues and pull requests, join my IRC channel (#directcode on, help out, or just give me encouragement.

Notice: We are looking for major contributors. Contact us by email or on IRC!



  • Works on the Server and in the Browser
  • Really Fast
  • Plugable API
  • Supports Authentication
  • Builtin OAuth2 Flow
  • Hook Server Helper

Work in Progress

  • Support all the GitHub APIs (Progress: 98%)

Getting Started

First, add the following to your pubspec.yaml:

  github: "^3.0.0"

Then import the library and use it:

For the Server

import 'package:github/server.dart';

void main() {
  /* Creates a GitHub Client */
  var github = createGitHubClient();
  github.repositories.getRepository(new RepositorySlug("DirectMyFile", "github.dart")).then((Repository repo) {
    /* Do Something */

For the Browser

import 'package:github/browser.dart';

void main() {
  /* Creates a GitHub Client */
  var github = createGitHubClient();
  github.repositories.getRepository(new RepositorySlug("DirectMyFile", "github.dart")).then((Repository repo) {
    /* Do Something */


To use a GitHub token:

var github = createGitHubClient(auth: new Authentication.withToken("YourTokenHere"));

Contacting Us

You can find us on and at #directcode.


  • BREAKING Removed a number of top-level methods from the public API.
  • BREAKING Removed markdown.dart library – use the markdown package instead.
  • BREAKING Removed the dates.dart library.


  • Automatically attempt to find GitHub user information in the process environment when running on the standalone VM.
  • Add ref parameter to getReadme method for the repository service.


  • Cache base64 decoded text property in GitHubFile
  • Fix Bug in EventPoller
  • Added id to Milestone


  • Moved CHANGELOG content back to repo.
  • Added rateLimitLimit, rateLimitRemaining and rateLimitReset to GitHub.
  • Added id to Issue
  • Added direction, sort and since optional arguments to IssueService.listByRepo.


NOTICE: This is a major breaking release. This really should have been v2.0.0

  • New Service based API
  • Git Data API Fully Implemented


  • File class renamed to GitHubFile (Breaking Change)
  • New Integration Tests (Tests the actual GitHub API).
  • Unit Testing System fully setup.
  • Git Data API partially implemented (this is a breaking change because of the new service system).
  • Fixes issues in fetching multiple repositories and users (fetching was very unreliable).
  • Adds a Markdown Rendering Helper (for rendering markdown in an element).
  • Team Membership API Implemented.
  • OAuth2 Flow API now uses some methods in the HTTP Library.
  • Organization Membership Updated to new API Changes.
  • Hook Server performance improvements.
  • Commit JSON Parsing now handles errors correctly.
  • Add Issue.toggleState() method which toggles it from open to closed or vice-versa.
  • Add Issue.isOpen and Issue.isClosed getters.


  • A few bug fixes.
  • New Tests
  • Benchmarks
  • Markdown Generation Library













All the things!




Initial Version

1. Depend on it

Add this to your package's pubspec.yaml file:

  github: "^3.0.2"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:github/browser.dart';

import 'package:github/server.dart';
Version Uploaded Documentation Archive
3.0.2 Jul 12, 2017 Go to the documentation of github 3.0.2 Download github 3.0.2 archive
3.0.0 Aug 29, 2016 Go to the documentation of github 3.0.0 Download github 3.0.0 archive
2.3.1+1 Jan 13, 2016 Go to the documentation of github 2.3.1+1 Download github 2.3.1+1 archive
2.3.1 Dec 4, 2015 Go to the documentation of github 2.3.1 Download github 2.3.1 archive
2.3.0 Oct 3, 2015 Go to the documentation of github 2.3.0 Download github 2.3.0 archive
2.2.3+1 Jun 30, 2015 Go to the documentation of github 2.2.3+1 Download github 2.2.3+1 archive
2.2.3 Jun 29, 2015 Go to the documentation of github 2.2.3 Download github 2.2.3 archive
2.2.2 Apr 16, 2015 Go to the documentation of github 2.2.2 Download github 2.2.2 archive
2.2.1 Apr 12, 2015 Go to the documentation of github 2.2.1 Download github 2.2.1 archive
2.2.0 Apr 12, 2015 Go to the documentation of github 2.2.0 Download github 2.2.0 archive

All 48 versions...


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 23, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
64 / 100
Code health derived from static analysis. [more]
70 / 100
Reflects how tidy and up-to-date the package is. [more]
85 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: web

Platform components identified in package: html, io.


  • Fix lib/src/common/users_service.dart.

    Strong-mode analysis of lib/src/common/users_service.dart failed with the following error:

    line: 39 col: 9
    The argument type 'Map<String, dynamic>' can't be assigned to the parameter type 'String'.

  • Fix lib/src/common/explore_service.dart.

    Strong-mode analysis of lib/src/common/explore_service.dart failed with the following error:

    line: 64 col: 30
    A value of type 'Element' can't be assigned to a variable of type 'String'.

  • Fix further 3 Dart files.

    Similar analysis of the following files failed:

    • lib/src/common/repos_service.dart
    • lib/src/common/activity_service.dart
    • lib/src/common/orgs_service.dart
  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 3 error(s) and 0 warning(s).

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use github.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 <2.0.0
html >=0.12.0 <0.14.0 0.13.2+2
http ^0.11.3 0.11.3+16
markdown ^0.11.1 0.11.4 1.1.1
quiver >=0.20.0 <0.25.0 0.24.0 0.28.0
xml ^2.0.0 2.6.0 3.0.0-alpha
Transitive dependencies
args 1.4.0
async 2.0.3 2.0.4
charcode 1.1.1
collection 1.14.5
csslib 0.14.1
http_parser 3.1.1
logging 0.11.3+1
matcher 0.12.1+4
path 1.5.1
petitparser 1.7.0
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
Dev dependencies
browser ^0.10.0+2
mockito ^1.0.1
test ^0.12.0