Skip to content

Conversation

araf-statsig
Copy link
Contributor

Description

Brief summary or screenshot of your changes

Best practice checklist

  • I've considered the best practices on where to put your doc and what to put in your doc
  • I've deleted and redirected old pages to this one, if any
  • I've updated links affected by this change, if any
  • I've updated screenshots affected by this change, if any

Questions?

Reach out to Brock or Tore on Slack!

@jasonwzm
Copy link
Member

jasonwzm commented Sep 29, 2025

@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 06:41 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 06:47 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 07:01 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 07:07 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 07:29 Inactive
@araf-statsig araf-statsig changed the title AWS edge integration doc 1st draft AWS edge integration doc Sep 29, 2025
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 07:41 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 07:49 Inactive

## Overview

Statsig now offers support to use statsig configs on AWS edge services, providing low latency for gate and experiment evaluations in your AWS project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this - "now" is meaningless.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed


Statsig now offers support to use statsig configs on AWS edge services, providing low latency for gate and experiment evaluations in your AWS project.

This integration uses the bring your own CDN model from the statsig edge client. This guide will highlight the most optimal setup for using statsig with AWS to leverage performance on the edge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bring your own CDN model from the statsig edge client"

This is also meaningless to someone reading the doc for the first time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed. I put this sentence here so it made a bit more sense later why the method is called initalizeFromCDN()


## S3 Storage Setup

The S3 bucket will be leveraged to store your statsig Config specifications. Since Amazon does not provide a traditional KV store for lambda@edge, we will treat the S3 storage as our KV store.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont use passive voice. "will be leveraged"

"For edge integrations, the statsig SDK needs access to storage located as close to the lambda as possible. On aws, we recommend storing your statsig project definition in an s3 bucket" or something like that.

Also, can you make this generic? Im pretty sure you can sub gcp function / gcp data store in for lambda/s3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed section paragraph

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc walks users through a start to finish setup using AWS. There are many AWS specific components in the doc. Wouldn't it make more sense to have a separate doc for GCP?

- Call the statsig CDN endpoint with you client key.

```bash
https://api.statsigcdn.com/v1/download_config_specs/<YOUR_CLIENT_API_KEY>.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this a curl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Comment on lines 103 to 105
**CRITICAL**: Must be created in **us-east-1** region

1. Change region to **us-east-1** (top-right corner)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? does this not work otherwise?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 116 to 118
This setup guide aims to complete every step through the AWS console. We suggest you work on your project on your local. Once you are ready to deploy your code, upload it as a zip to your function's code tab. Ensure your project is built and all packages are installed before you test or deploy it in the Lambda console.

Further explanation and breakdown of the usage of the statsig SDK within this code will be provided later in this guide.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it clear which variables they need to plug in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Further explanation and breakdown of the usage of the statsig SDK within this code will be provided later in this guide.

```javascript
import { StatsigEdgeClient } from "@statsig/edge-client";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt exist yet, but good ot have the docs ready

Comment on lines 156 to 167
callback(null, {
status: "200",
statusDescription: "OK",
headers: {
"content-type": [{ key: "Content-Type", value: "application/json" }],
},
body: JSON.stringify({
success: false,
error: error.message,
message: "Fallback response",
}),
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sdk initialization shouldnt really have a fialure case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

4. Click **Publish**
5. **Copy the Version ARN** (ends with :1) - you'll need this for CloudFront

### Create IAM Execution Role for Lambda@Edge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is this specific to lambda at edge, but not lambda? can we make the setup for just lambda clear?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Comment on lines 260 to 266
### Install

```bash
npm install @statsig/edge-client
```

Install the statsig edge SDK. This SDK is a one stop shop for all edge integrations, including AWS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird that you go back to lambda and THEN break down the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Copy link
Contributor

@tore-statsig tore-statsig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guide doesnt mention anything about how to keep the spec up to date

@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 18:48 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 19:54 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 20:08 Inactive
@jasonwzm jasonwzm temporarily deployed to pull request September 29, 2025 20:12 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants