This guide explains how Spoke manages data exports and how to configure them in your installation.
When a user requests a data export, Spoke prepares it behind the scenes. When the data is ready, it is uploaded to a cloud storage bucket (AWS's S3 or GCP's GCS). Once the exported data has been added to the bucket, Spoke sends an email notification to the user who requested the export with a link to download the data file.
To enable data exporting, you will need:
- To configure Spoke to send emails
- Access to a cloud storage service
- A cloud storage bucket in that account
First, configure Spoke to send emails (see email configuration).
- Create an AWS account. If you already have an AWS account, skip this step. Otherwise, see Amazon's documentation to create an AWS account.
- Sign up for S3. If you already have S3, skip this step. Otherwise, see Amazon's documentation to sign up for S3 using your AWS account.
- Create a S3 bucket. If you already have an S3 bucket, skip this step. Otherwise, see Amazon's documentation to create an S3 bucket. You don't need to enable public access to the bucket.
- Configure Spoke environment variables. In order for Spoke to connect to S3, the following environment variables must be set:
EXPORT_DRIVER=s3
AWS_ACCESS_KEY_ID
AWS_S3_BUCKET_NAME
AWS_SECRET_ACCESS_KEY
If you've reached this point in application setup, you've probably configured environment variables already. Here are Heroku and AWS Lambda instructions. Locally, you can use a .env
file or the like.
- Create a GCP Account
- Create a GCS Bucket.
- Create a Service Account -- Create a service account from the IAM section of GCP. You'll need to download the json key for that service account. You'll also need to grant the service account acccess to the bucket. This can be done from the GCS bucket configuration page using the service account's email address.
- Configure Spoke environment variables. In order for Spoke to connect to GCS, the following environment variables must be set:
EXPORT_DRIVER=gs-json
AWS_S3_BUCKET_NAME
-- the name of the GCS bucket (ex.exports.spokerewired.com
)GOOGLE_APPLICATION_CREDENTIALS
-- the value of the JSON keyfile for the service account.- (optional)
AWS_S3_KEY_PREFIX=client-one/