This guide provides instructions on how to apply for and use API keys for POWERBACK's third-party services, including Stripe, ProPublica Congress API, and Google Civics.
This guide assumes you are following our Development Setup Guide.
-
Visit the Stripe website.
-
Sign up for a Stripe account if you don't already have one.
-
Log in to your Stripe dashboard.
-
Navigate to the API section in your dashboard.
-
Create a new API key and specify its permissions. Be sure to select payment processing as a required permissions.
-
Note down any the generated API keys for use in your POWERBACK environment. Keep these safe.
-
Open your POWERBACK project.
-
Edit your
.envfile in the project root. -
Set the Stripe environment variables:
# For development (test keys) STRIPE_PK_TEST=pk_test_... STRIPE_SK_TEST=sk_test_... STRIPE_SIGNING_SECRET_CLI=whsec_... # For production (live keys) STRIPE_PK_LIVE=pk_live_... STRIPE_SK_LIVE=sk_live_... STRIPE_SIGNING_SECRET_WORKBENCH=whsec_...
-
Save the changes and restart your POWERBACK server to apply the new API keys.
Note: Stripe public keys are loaded at runtime from the server via /api/config/stripe-key endpoint, so you don't need to hardcode them in client files. The system automatically uses test keys in development and live keys in production based on NODE_ENV.
-
Visit the Federal Election Commission (FEC) API website.
-
Sign up for an FEC account if required.
-
Request an API key from the FEC for access to campaign finance data. Follow the provided instructions to obtain your key.
-
Note down the generated API key for use in your POWERBACK environment.
-
Refer to the FEC API documentation.
-
Open your POWERBACK project.
-
Edit your
.envfile in the project root. -
Set the
FEC_API_KEYenvironment variable with your FEC API key:FEC_API_KEY=your-api-key-here
-
Save the changes and restart your POWERBACK server to apply the new API key.
-
Visit the Congress.GOV API website.
-
Sign up for a Congress.GOV account if required.
-
Request an API key from Congress.GOV for access to legislative data. Follow the provided instructions to obtain your key.
-
Note down the generated API key for use in your POWERBACK environment.
-
Refer to the Congress.GOV API documentation.
-
Open your POWERBACK project.
-
Edit your
.envfile in the project root. -
Set the
CONGRESS_GOV_API_KEYenvironment variable with your Congress.GOV API key:CONGRESS_GOV_API_KEY=your-api-key-here
-
Save the changes and restart your POWERBACK server to apply the new API key.
-
Go to the Google Cloud Console APIs & Services page.
-
Sign in with your Google account or create one if you don't have an account.
-
Click on Credentials in the left sidebar.
-
Create a new API key by clicking on the Create credentials button and selecting API key, or select an existing API key.
-
If you're creating a new key, note down the generated API key. You'll need this key to access the Google Civics API.
-
Ensure the Google Civics Information API is enabled for your project:
- Navigate to APIs & Services > Library
- Search for "Google Civics Information API" and enable it if not already enabled
For enhanced security, you can configure IP address restrictions on your API key:
-
In the Google Cloud Console, go to APIs & Services > Credentials.
-
Click on your API key to edit it.
-
Under API restrictions, you can restrict which APIs the key can access.
-
Under Application restrictions, select IP addresses (web servers, cron jobs, etc.).
-
Add your IP addresses to the allowlist:
- For development environments: Add your local development machine's public IP address. If your IP changes, you'll need to update the allowlist.
- For production environments: Add your production server's IP address(es).
-
Save your changes.
Note: If you set up IP restrictions, any requests from IPs not on the allowlist will be rejected. This is how the project maintainer has configured their setup for security, but you can choose to skip IP restrictions if you prefer a less strict configuration.
-
Open your POWERBACK project.
-
Edit your
.envfile in the project root. -
Set the
GOOGLE_CIVICS_API_KEYenvironment variable with your Google Civics API key:GOOGLE_CIVICS_API_KEY=your-api-key-here
-
Save the changes and restart your POWERBACK server to apply the new API key.
By following these instructions, you can apply for and use API keys for the third-party services needed to run POWERBACK. If you have any questions please reach out at support@powerback.us.
Return to the Development Setup Guide.
- Development Setup Guide - Complete setup instructions
- Environment Management - Environment configuration
- API Documentation - API endpoints that use these keys