Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Created March 1, 2018 02:40
Show Gist options
  • Save adamjstevenson/983689f508d5bd7bf5b2c80c7757e754 to your computer and use it in GitHub Desktop.
Save adamjstevenson/983689f508d5bd7bf5b2c80c7757e754 to your computer and use it in GitHub Desktop.
Setting up a function for Twilio and GDAX
// Use dotenv to load environment variables
require('dotenv').config();
// Load Twilio and GDAX
const twilio = require('twilio');
const gdax = require('gdax');
// Set up GDAX for buying crypto
const gdaxClient = new gdax.AuthenticatedClient(
process.env.GDAX_API_KEY,
process.env.GDAX_SECRET,
process.env.GDAX_PASSPHRASE,
process.env.GDAX_API_ENDPOINT
);
// Set up Twilio client for sending SMS
const twilioClient = twilio(
process.env.TWILIO_ACCOUNT_SID,
process.env.TWILIO_AUTH_TOKEN
);
// Add a handler next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment