github 4.0.0

  • 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.


  • Make fields in many objects read-only.
  • Initial support for comparing commits.
  • Require at least Dart 2.0.0-dev.36.
  • Fix a number of type issues dealing with JSON.
  • BREAKING Removed ExploreServiceGitHub.explore.
  • BREAKING Removed MiscService.listOctodex.
  • BREAKING Removed BlogService -


  • 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

Use this package as a library

1. Depend on it

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

  github: ^4.0.0

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
4.0.0 Nov 6, 2018 Go to the documentation of github 4.0.0 Download github 4.0.0 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

All 49 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: web

Platform components identified in package: html, io.

Maintenance suggestions

The description is too short. (-20 points)

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. Packages with multiple examples should use example/


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http >=0.11.3 <0.13.0 0.12.0
http_parser ^3.1.1 3.1.3
json_annotation ^2.0.0 2.0.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
meta 1.1.6
path 1.6.2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
Dev dependencies
build_runner ^1.0.0
json_serializable ^2.0.0
mockito ^3.0.0
test ^1.3.0