Stripe API Keys

Stripe is a company based in the USA that processes payments for its customers. It makes the process of collecting payments easy. Stripe provides its users with access to its infrastructure through a set of API keys. These keys are created on the Stripe dashboard.

We’ll need to create an account with Stripe to obtain our authentication keys. Click here to create a Stripe account.

Two keys are provided that can be used to authenticate a user who wants to connect to Stripe. Open the settings-dev.json file. One key is secret and should only be used in a server environment, and one is publishable, which can be used on the client-side. Remember that our settings can contain both a public and a private section that are used to load values. On line 9, the secret server-only key is defined, while the other key that can be exposed to the client is defined inside a public object key on line 12.

Remember: The server key should never be exposed. It should only be used in a server environment.

Installing Stripe SDK

Stripe provides a Software Developer Kit (SDK) that makes it easy for a developer to integrate Stripe. To integrate Stripe into a Meteor project, we’ll need to install two packages from npm. Opening the package.json file should reveal the entry for the installed packages on lines 12–13. Remember that the package.json file holds the list of packages required for the application to run.

The packages were installed by running the following command on the project’s terminal:

Get hands-on with 1200+ tech skills courses.