Stripe is redefining e-commerce. Patrick and John Collison had a very specific insight into the future of internet businesses: primarily, they’re driven by the who build them. They have, along with one of the most , teams in Silicon Valley, created a with powerful financial APIs as the centerpiece. software developers talented creative $9.2B business At , we share a similar vision of the future of business. Our goal is to lower the barrier to entry to creating web products based on new “serverless” technology. We make it even easier for a broader class of developer to build backend services and integrate with companies like , and . Today we’re pleased to show you how in only a few minutes, you can build a production-ready Stripe-powered store that is fully-customizable using StdLib. StdLib (“Standard Library”) Slack to build bots Twilio to build messaging hubs We think you’ll find with StdLib that you’ve never had an easier time managing web services. You only have to think in functions, and we have a suite of . powerful command line tools that allow for rapid local development and testing Once you’ve created your StdLib service in , you’ll get a file but can also follow along via . Minute 5 README.md GitHub in the stdlib/utils.templates stripe folder What You’ll Need Beforehand 1x Stripe Account (We recommend a ) new account 1x Command Line Terminal 5x Minutes (or 300x Seconds) Minute 1: Preparing Your Stripe Account First, make sure you’ve . We recommend creating a new account because your StdLib store will spontaneously create new products and update your Stripe product information based on configuration you’ve set. To prevent side effects on an already existing account, it’s safest to use a new account. created a new Stripe account Once you have your Stripe account, visit the . You don’t need an activated account yet, you’re okay to just use test data to get up and running. Click in the bottom left of the menu to take you to the and then . Keep this page open, you’ll need these API keys shortly. Stripe Dashboard API API keys page Reveal test key token Minute 2: Create a StdLib Account You’ll now need a to create your “serverless” Stripe Store. We don’t need anything other than a StdLib account and Stripe account to create a store, as Stripe stores product information for us. Navigate to and click to create your account. StdLib Account https://stdlib.com Sign Up Click “Sign Up” to Proceed Minute 3: Initialize Your StdLib Workspace To use StdLib, we recommend using the latest stable version of Node.js, ideally 8.2.x or higher installed from the . Once complete, open up your Terminal or Command Line and install the with the following: Official Node.js Website StdLib Command Line Tools $ npm install lib.cli -g At least , you can check with . You should now have access to the command in your terminal. You can use this to make a directory for your StdLib services. Please make sure you are running the latest version. 3.1.1 lib version lib stdlib $ mkdir stdlib$ cd stdlib$ lib init Use the StdLib credentials you created in the previous step to log in. That’s it, you’re done! Minute 4: Create Your Stripe Store The next step is creating your Stripe Store using StdLib. You can use the template to automatically generate your Stripe Store for you. stripe $ lib create -s @stripe/store When you proceed, you’ll be asked for a , we suggest , but you can name it whatever you’d like. Service Name stripe-store By specifying , you’re telling the Standard Library template service to use the Stripe boilerplate (other options include ). This will automatically populate your service with the code you need to run your store, and is fully hackable. -s @stripe/store @slack/app To visit the service you’ve just created, enter the following into your terminal: $ cd <username>/stripe-store To make sure your Stripe Store is working as expected, try running a HTTP gateway for your StdLib function locally: $ lib http You’ll see the following: To visit your Stripe Store and make sure it works, copy and paste the URL provided, into your web browser: localhost:8170/<username>/stripe-store/ Awesome! Your Stripe Store is almost ready to go. You can stop your HTTP server at any time by pressing or in your terminal. ctrl+C ctrl+D Minute 5: Set Stripe Credentials and Deploy Remember your Stripe credentials from ? You’ll want to make sure you bring up that window or open the again. Open up in your service directory, and enter your credentials into the and environments. Minute 1 API keys page ./env.json "local" "dev" Enter Your Credentials When you’re ready to deploy to production, you can put your production credentials in , but it’s not necessary right now. "release" You’re now ready to deploy your Stripe Store! Simply open your terminal and type: $ lib up dev You’ll notice something similar to the following output: There’s a deploy script in that will automatically read from and update your Stripe product line accordingly, based on the JSON configuration. It runs a diff algorithm to make sure nothing is deleted, only either deactivated, updated or created. ./stripe/scripts/ ./stripe/products.json products.json contains your Stripe Products After deploying, you’ll be provided with a link to your new Store: A link to your Store via HTTPS This is the last thing you need to access your Stripe store. That’s it! Your Stripe Store is live! Visit your Stripe Store by copying the link provided in the last step, typically . You’ll see your default products from all ready to go! https://<username>.lib.id/stripe-store@dev/ products.json Your Stripe Store is Live! You can test placing orders with any e-mail, name, address and the credit card number along with any expiry date ( ) and any CVV. You can see your products in the Stripe Dashboard at any time on the . You can update these manually, or in your file and do a new deploy. 4242 4242 4242 4242 in the future Stripe Products Dashboard Page ./stripe/products.json Your Products on your Stripe Dashboard To release to production, , switch your environment to and copy your new API keys to your keys in . You’ll have to use the command instead of . activate your Stripe account from your Stripe Dashboard live "release" ./env.json $ lib release $ lib up dev Additionally, your Stripe store is fully hackable! Change any of the HTML, styles, etc. to your heart’s content. Simply modify any of the files in your service package, test locally with , and deploy new products / etc. when you’re ready. $ lib http Thank You! Thanks for reading, and we’re excited about the possibilities of things you can create with Stripe and StdLib! For suggestions or questions, feel free to comment here or . If you have a neat idea, reach out to me directly by e-mail: , send me a tweet on Twitter, , or . visit the stdlib/lib repository on GitHub keith [at] stdlib [dot] com @keithwhor follow us on Twitter, @StdLibHQ We look forward to hearing from you, and happy building!