Optimizely Full Stack
Using the Fastly CLI, create a new project using this starter somewhere on your computer:
$ fastly compute init --from=https://github.com/optimizely/fastly-compute-starter-kit
Or click the button below to create a GitHub repository, provision a Fastly service, and set up continuous deployment:
Out of the box, Optimizely's Full Stack SDKs require a user-provided identifier to be passed in at runtime to drive experiment and feature flag decisions. This example generates a unique ID, stores it in a cookie and reuses it to make the decisions sticky. Alternatively, you can use an existing unique identifier available within your application and pass it in as the value for the
For more information on how Optimizely Full Stack SDKs assign users to feature flags and experiments, see the documentation on how bucketing works.
You will need to complete the following prerequisites to use this template:
- Have a Compute@Edge account and the Fastly CLI installed. For more information view the Compute@Edge getting started documentation.
- Have an Optimizely account. If you do not have an account, you can register for a free account.
Create a new folder and initialize a Fastly Compute@Edge service using the Fastly CLI from this template.fastly compute init --from https://github.com/optimizely/fastly-compute-starter-kit
Follow the wizard and provide the service name, description and any other information. a) Add your
fastly.toml, if you want to use an existing Fastly service.
Update your Optimizely
src/index.js. Your SDK keys can be found in the Optimizely application under Settings.
Build and publish:fastly compute publish
Monitor logs:fastly log-tail
- Fastly - Compute@Edge official documentation
- Fastly Compute@Edge with Optimizely documentation
Starters are a good way to bootstrap a project. For more specific use cases, and answers to common problems, try our library of code examples.