Skip to content

Zaeburn/node-bird

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-bird

An API for Bird Scooters

Usage

const Bird = require('node-bird');
const bird = new Bird((options = {}));

How to use options

const Bird = require('node-bird');
const bird = new Bird({
  timeout: 3000000000,
  headers: {
    'User-Agent': 'Nintendo 64',
    'Device-id': 'your_own_uuid',
    Platform: 'ios',
    'App-Version': 'the latest version'
  }
  ...whatever you need to add
});

For a cool example, see example/index.js

Log in

bird.login((email = faker.internet.email()));

Verify email

bird.verifyCode(code);

Get user agreements

bird.getUserAgreement();

Accept user agreements

bird.acceptUserAgreement(uaId);

Get profile

bird.getProfile();

Update profile

bird.updateProfile(profile);

Add voucher code

bird.addVoucherCode(code);

Get Scooters Nearby

bird.getScootersNearby(latitude, longitude, (radius = 500));

Get Scooter details

bird.getScooterDetails(scooterId);
scooterId is not scooterCode

Set alarm for a scooter

bird.setScooterAlarm(scooterId);

Set missing for a scooter

bird.setScooterMissing(scooterId);

Scan scooter

bird.scanScooter(scooter);
scooter can be fetched from getScootersNearby array, or from getScooterDetails if you already know scooterId

Ride scooter

bird.rideScooter(scooter);
scooter can be fetched from getScootersNearby array

Stop ride

bird.stopRide(scooter, ride);
scooter can be fetched from getScootersNearby array
ride is returned from rideScooter method

Add card registered with Stripe to account

bird.addCardFromStripe(stripeToken, { latitude = faker.address.latitude(), longitude = faker.address.longitude() });

Get Stripe Customer

bird.getStripeCustomer();

Set card as default source in your Bird account

bird.setCardAsDefault(cardId, latitude = faker.address.latitude(), longitude = faker.address.longitude() });

About

API Wrapper for Bird scooters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%