Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

23andme

23andMe API wrapper.

23andmeapiclientnodewrapperbiologydnagenomegenomicsnode.jsgene
Published15 Apr 2016
Direct dependencies3
Transitive dependenciesNot calculated

README

Current package documentation

23andme NPM version

JavaScript wrapper for the 23andMe API.

Installation

Install the package with NPM:

$ npm install 23andme

Usage

Minimal example:

import API from "23andme";

let clientId = "fake_client_id";
let clientSecret = "fake_client_secret";
let redirectUri = "http://localhost:9000/receive_code";
let scope = ["ancestry"];
let api = new API(clientId, clientSecret, redirectUri, scope);

function receiveCode(code) {
  api.auth(code)
  .then(() => api.ancestry())
  .then(ancestry => console.log(ancestry))
  .catch(err => console.error(err));
}

As can be seen, the package exposes an API wrapper class that can be instantiated. This class has the following methods:

  • constructor(clientId, clientSecret, redirectUri, scope)
    • Creates an instance of the class.
  • auth(code)
    • Authenticates with the 23andMe API by exchanging an authorization code for an authorization token.
    • Returns a Promise of the authorization token.
    • Call this method first before you make any API requests!
  • user()
    • Retrieves data from the API's /user endpoint.
    • Returns a Promise of the endpoint's response data.
  • names()
    • Retrieves data from the API's /names endpoint.
    • Returns a Promise of the endpoint's response data.
  • haplogroups()
    • Retrieves data from the API's /haplogroups endpoint.
    • Returns a Promise of the endpoint's response data.
  • ancestry()
    • Retrieves data from the API's /ancestry endpoint.
    • Returns a Promise of the endpoint's response data.
  • familyMembers()
    • Retrieves data from the API's /family_members endpoint.
    • Returns a Promise of the endpoint's response data.
  • relatives()
    • Retrieves data from the API's /relatives endpoint.
    • Returns a Promise of the endpoint's response data.

And the following properties:

  • authUri
    • The URI to redirect the user's Web browser to in order for them to login to 23andMe and be granted an authorization code. (When 23andMe sends the authorization code to your server, pass it to the auth() method!)
  • baseUri
    • The base URI of the 23andMe API.
  • token
    • The authorization token granted when auth() was called.

Disclaimer

The package is not officially affiliated with 23andMe in any way. Use at own risk.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
babel-cli
Environment
{
  "local_name": "babel-cli",
  "alias": false,
  "peer_metadata": null
}
6.7.5development
babel-preset-es2015
Environment
{
  "local_name": "babel-preset-es2015",
  "alias": false,
  "peer_metadata": null
}
6.6.0development
rimraf
Environment
{
  "local_name": "rimraf",
  "alias": false,
  "peer_metadata": null
}
2.5.2development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "bfb5835366d376858b2ce30e0be7d0153907a13d",
  "tarball": "https://registry.npmjs.org/23andme/-/23andme-1.0.0.tgz",
  "integrity": "sha512-2jNYnHnNOhTYDJaZpukx1x2HK4d4blkyLTCZtJxrzI3jJdNqi7JK3PfCYp2l+Re8Hd3Yo1GqSECJ6ZOVlDP4ig==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIHEhGfTiQ+Vc6ecJAJ23s873KD0aIR8OJEkrzS5WI/zZAiACqnFCVoVZO+oUrMrk6owpxf1qHvnPsCWwPSkVkG8hgA=="
    }
  ]
}

Repository

PENDING
turingou/23andme

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
lukehorvat/23andme

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:01 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:764fbdc913138e8e1d0407fd36ba60fc75bb3d3d1ba3a386565aec554e53bab8

Other collected versions

1.1.018 Apr1.0.116 Apr0.0.05 SeptView all collected versions →